mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2026-05-05 09:57:21 +02:00
25c456dab5
Pull MFD updates from Lee Jones:
"Core:
- Add a resource-managed version of alloc_workqueue()
(`devm_alloc_workqueue()`)
- Preserve the Open Firmware (OF) node when an ACPI handle
is present
Apple SMC:
- Wire up the Apple SMC power driver by adding a new MFD cell
Atmel HLCDC:
- Fetch the LVDS PLL clock as a fallback if the generic sys_clk
is unavailable
Broadcom BCM2835 PM:
- Add support for the BCM2712 power management device
- Introduce a hardware type identifier to distinguish SoC variants
Congatec CGBC, KEMPLD, RSMU, Si476x:
- Fix various kernel-doc warnings and correct struct member names
DLN2:
- Drop redundant USB device references and switch to managed
resource allocations
- Update bare 'unsigned' types to 'unsigned int'
ENE KB3930:
- Use the of_device_is_system_power_controller() wrapper
EZX PCAP:
- Avoid rescheduling after destroying the workqueue by switching
to a device-managed workqueue
- Drop redundant memory allocation error messages
- Return directly instead of using empty goto statements
Freescale i.MX25 TSADC:
- Convert devicetree bindings from TXT to YAML format
Freescale MC13xxx:
- Fix a memory leak in subdevice platform data allocation by
using devm_kmemdup()
Intel LPC ICH:
- Expose a software node for the GPIO controller cell to fix
GPIO lookups
Intel LPSS:
- Add PCI IDs for the Intel Nova Lake-H platform
Maxim MAX77620:
- Convert devicetree bindings from TXT to YAML format
- Document an optional I2C address for the MAX77663 RTC device
Maxim MAX77705:
- Make the max77705_pm_ops variable static to resolve a
sparse warning
MediaTek MT6397:
- Correct the hardware CIDs for the MT6328, MT6331, and MT6332
PMICs to allow proper driver binding
ROHM BD71828:
- Enable system wakeup via the power button
ROHM BD72720:
- Add a new compatible string for the ROHM BD73900 PMIC
SpacemiT P1:
- Drop the deprecated "vin-supply" property from the devicetree
bindings
- Add individual regulator supply properties to match actual
hardware topology
STMicroelectronics STPMIC1:
- Attempt system shutdown a second time to handle transient I2C
communication failures
Viperboard:
- Drop redundant USB device references"
* tag 'mfd-next-7.1' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (28 commits)
mfd: core: Preserve OF node when ACPI handle is present
mfd: ene-kb3930: Use of_device_is_system_power_controller() wrapper
mfd: intel-lpss: Add Intel Nova Lake-H PCI IDs
dt-bindings: mfd: max77620: Document optional RTC address for MAX77663
dt-bindings: mfd: max77620: Convert to DT schema
mfd: ezx-pcap: Avoid rescheduling after destroying workqueue
mfd: ezx-pcap: Return directly instead of empty gotos
mfd: ezx-pcap: Drop memory allocation error message
mfd: bcm2835-pm: Add BCM2712 PM device support
mfd: bcm2835-pm: Introduce SoC-specific type identifier
dt-bindings: mfd: bd72720: Add ROHM BD73900
mfd: si476x: Fix kernel-doc warnings
mfd: rsmu: Remove a empty kernel-doc line
mfd: kempld: Fix kernel-doc struct member names
mfd: congatec: Fix kernel-doc struct member names
dt-bindings: mfd: Convert fsl-imx25-tsadc.txt to yaml format
mfd: viperboard: Drop redundant device reference
mfd: dln2: Switch to managed resources and fix bare unsigned types
mfd: macsmc: Wire up Apple SMC power driver
mfd: mt6397: Properly fix CID of MT6328, MT6331 and MT6332
...
128 lines
4.1 KiB
C
128 lines
4.1 KiB
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
/*
|
|
* Kontron PLD driver definitions
|
|
*
|
|
* Copyright (c) 2010-2012 Kontron Europe GmbH
|
|
* Author: Michael Brunner <michael.brunner@kontron.com>
|
|
*/
|
|
|
|
#ifndef _LINUX_MFD_KEMPLD_H_
|
|
#define _LINUX_MFD_KEMPLD_H_
|
|
|
|
/* kempld register definitions */
|
|
#define KEMPLD_IOINDEX 0xa80
|
|
#define KEMPLD_IODATA 0xa81
|
|
#define KEMPLD_MUTEX_KEY 0x80
|
|
#define KEMPLD_VERSION 0x00
|
|
#define KEMPLD_VERSION_LSB 0x00
|
|
#define KEMPLD_VERSION_MSB 0x01
|
|
#define KEMPLD_VERSION_GET_MINOR(x) (x & 0x1f)
|
|
#define KEMPLD_VERSION_GET_MAJOR(x) ((x >> 5) & 0x1f)
|
|
#define KEMPLD_VERSION_GET_NUMBER(x) ((x >> 10) & 0xf)
|
|
#define KEMPLD_VERSION_GET_TYPE(x) ((x >> 14) & 0x3)
|
|
#define KEMPLD_BUILDNR 0x02
|
|
#define KEMPLD_BUILDNR_LSB 0x02
|
|
#define KEMPLD_BUILDNR_MSB 0x03
|
|
#define KEMPLD_FEATURE 0x04
|
|
#define KEMPLD_FEATURE_LSB 0x04
|
|
#define KEMPLD_FEATURE_MSB 0x05
|
|
#define KEMPLD_FEATURE_BIT_I2C (1 << 0)
|
|
#define KEMPLD_FEATURE_BIT_WATCHDOG (1 << 1)
|
|
#define KEMPLD_FEATURE_BIT_GPIO (1 << 2)
|
|
#define KEMPLD_FEATURE_MASK_UART (7 << 3)
|
|
#define KEMPLD_FEATURE_BIT_NMI (1 << 8)
|
|
#define KEMPLD_FEATURE_BIT_SMI (1 << 9)
|
|
#define KEMPLD_FEATURE_BIT_SCI (1 << 10)
|
|
#define KEMPLD_SPEC 0x06
|
|
#define KEMPLD_SPEC_GET_MINOR(x) (x & 0x0f)
|
|
#define KEMPLD_SPEC_GET_MAJOR(x) ((x >> 4) & 0x0f)
|
|
#define KEMPLD_IRQ_GPIO 0x35
|
|
#define KEMPLD_IRQ_GPIO_MASK 0x0f
|
|
#define KEMPLD_IRQ_I2C 0x36
|
|
#define KEMPLD_CFG 0x37
|
|
#define KEMPLD_CFG_GPIO_I2C_MUX (1 << 0)
|
|
#define KEMPLD_CFG_BIOS_WP (1 << 7)
|
|
|
|
#define KEMPLD_CLK 33333333
|
|
|
|
#define KEMPLD_TYPE_RELEASE 0x0
|
|
#define KEMPLD_TYPE_DEBUG 0x1
|
|
#define KEMPLD_TYPE_CUSTOM 0x2
|
|
|
|
#define KEMPLD_VERSION_LEN 10
|
|
|
|
/**
|
|
* struct kempld_info - PLD device information structure
|
|
* @major: PLD major revision
|
|
* @minor: PLD minor revision
|
|
* @buildnr: PLD build number
|
|
* @number: PLD board specific index
|
|
* @type: PLD type
|
|
* @spec_major: PLD FW specification major revision
|
|
* @spec_minor: PLD FW specification minor revision
|
|
* @version: PLD version string
|
|
*/
|
|
struct kempld_info {
|
|
unsigned int major;
|
|
unsigned int minor;
|
|
unsigned int buildnr;
|
|
unsigned int number;
|
|
unsigned int type;
|
|
unsigned int spec_major;
|
|
unsigned int spec_minor;
|
|
char version[KEMPLD_VERSION_LEN];
|
|
};
|
|
|
|
/**
|
|
* struct kempld_device_data - Internal representation of the PLD device
|
|
* @io_base: Pointer to the IO memory
|
|
* @io_index: Pointer to the IO index register
|
|
* @io_data: Pointer to the IO data register
|
|
* @pld_clock: PLD clock frequency
|
|
* @feature_mask: PLD feature mask
|
|
* @dev: Pointer to kernel device structure
|
|
* @info: KEMPLD info structure
|
|
* @lock: PLD mutex
|
|
*/
|
|
struct kempld_device_data {
|
|
void __iomem *io_base;
|
|
void __iomem *io_index;
|
|
void __iomem *io_data;
|
|
u32 pld_clock;
|
|
u32 feature_mask;
|
|
struct device *dev;
|
|
struct kempld_info info;
|
|
struct mutex lock;
|
|
};
|
|
|
|
/**
|
|
* struct kempld_platform_data - PLD hardware configuration structure
|
|
* @pld_clock: PLD clock frequency
|
|
* @gpio_base: GPIO base pin number
|
|
* @ioresource: IO addresses of the PLD
|
|
* @get_hardware_mutex: PLD specific get_mutex callback
|
|
* @release_hardware_mutex: PLD specific release_mutex callback
|
|
* @get_info: PLD specific get_info callback
|
|
* @register_cells: PLD specific register_cells callback
|
|
*/
|
|
struct kempld_platform_data {
|
|
u32 pld_clock;
|
|
int gpio_base;
|
|
struct resource *ioresource;
|
|
void (*get_hardware_mutex) (struct kempld_device_data *);
|
|
void (*release_hardware_mutex) (struct kempld_device_data *);
|
|
int (*get_info) (struct kempld_device_data *);
|
|
int (*register_cells) (struct kempld_device_data *);
|
|
};
|
|
|
|
extern void kempld_get_mutex(struct kempld_device_data *pld);
|
|
extern void kempld_release_mutex(struct kempld_device_data *pld);
|
|
extern u8 kempld_read8(struct kempld_device_data *pld, u8 index);
|
|
extern void kempld_write8(struct kempld_device_data *pld, u8 index, u8 data);
|
|
extern u16 kempld_read16(struct kempld_device_data *pld, u8 index);
|
|
extern void kempld_write16(struct kempld_device_data *pld, u8 index, u16 data);
|
|
extern u32 kempld_read32(struct kempld_device_data *pld, u8 index);
|
|
extern void kempld_write32(struct kempld_device_data *pld, u8 index, u32 data);
|
|
|
|
#endif /* _LINUX_MFD_KEMPLD_H_ */
|