mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-11-01 17:08:10 +00:00
6eb59af580
- Add new driver for MAXIM MAX77620/MAX20024 PMIC - Add new driver for Hisilicon HI665X PMIC - New Device Support - Add support for AXP809 in axp20x-rsb - Add support for Power Supply in axp20x - New core features - devm_mfd_* managed resources - Fix-ups - Remove unused code; da9063-irq, wm8400-core, tps6105x, smsc-ece1099, twl4030-power - Improve clean-up in error path; intel_quark_i2c_gpio - Explicitly include headers; syscon.h - Allow building as modules; max77693 - Use IS_ENABLED() instead of rolling your own; dm355evm_msp, wm8400-core - DT adaptions; axp20x, hi655x, arizona, max77620 - Remove CLK_IS_ROOT flag; intel-lpss, intel_quark - Move to gpiochip API; asic3, dm355evm_msp, htc-egpio, htc-i2cpld, sm501, tc6393xb, tps65010, ucb1x00, vexpress - Make use of devm_mfd_* calls; act8945a, as3711, atmel-hlcdc, bcm590xx, hi6421-pmic-core, lp3943, menf21bmc, mt6397, rdc321x, rk808, rn5t618, rt5033, sky81452, stw481x, tps6507x, tps65217, wm8400, - Bug Fixes - Fix ACPI child matching; mfd-core - Fix start-up ordering issues; mt6397-core, arizona-core - Fix forgotten register state on resume; intel-lpss - Fix Clock related issues; twl6040 - Fix scheduling whilst atomic; omap-usb-tll - Kconfig changes; vexpress -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAABCAAGBQJXPzwAAAoJEFGvii+H/HdhkPEP/iTvgiL+CpAk7UwAhCNolR5j l3vb49lOlmqx87zELdToJmySAd/byiZN0YQEmcn+t4BCs/8CeaWeNkb8vltJvuac Fmz88bhXfgFYk87nx/6tRMvuM3fKXlk/YYRZkklV7mkBjcPLiqBZSi/MG/SV53a9 A+vGW56B2/vHiUgTBkYs9UZNqkFCkmhuVYbHjtFwTfL84lwy9u4tNRrktss6g1lx Ak9uiDhaUP/vxKe/7/qCTZXgV/IYb2+tcNjMJ+Cztmyht8VTrhGSXbDPH7MyRYUI EBBWRXAQelR5qHxOYDSBNIemZe3AniCBp7tjqcwlN9cdE8q9pJxOk+0XStjC+XeW Qt1aIwQisk8jfII8BIGr2pAzc8Jh9/TtcK+wKMRQ2o5g2tvcG90hHIJWQlbdy4ST SX799w0KvTItdaMhTHThTOfJRj777v/H2cj8DBCCEeoBHOCHnzbJSIuKahPa9PM3 W0dyZOpsDXoegyksjBUYjdhGoggjEdirt+oXJe4rY7UxeEml+YZS54fseVzgNzNq //Nxk1GMNOVXgo3NrlO8JTs2G5gFPc8VOuPW60G1fm8DyNW13RbUG74QPpSd4U7S zZM/OZ3D0E4nrPjXf/GCS3QRwM7p1ubiOgSTTZkaLJYGBcHSezGXK8XpFSNReRop Un13GPM09Sl9VN9a2Ybi =FSmn -----END PGP SIGNATURE----- Merge tag 'mfd-for-linus-4.7' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd Pull MFD updates from Lee Jones: "New Drivers: - Add new driver for MAXIM MAX77620/MAX20024 PMIC - Add new driver for Hisilicon HI665X PMIC New Device Support: - Add support for AXP809 in axp20x-rsb - Add support for Power Supply in axp20x New core features: - devm_mfd_* managed resources Fix-ups: - Remove unused code (da9063-irq, wm8400-core, tps6105x, smsc-ece1099, twl4030-power) - Improve clean-up in error path (intel_quark_i2c_gpio) - Explicitly include headers (syscon.h) - Allow building as modules (max77693) - Use IS_ENABLED() instead of rolling your own (dm355evm_msp, wm8400-core) - DT adaptions (axp20x, hi655x, arizona, max77620) - Remove CLK_IS_ROOT flag (intel-lpss, intel_quark) - Move to gpiochip API (asic3, dm355evm_msp, htc-egpio, htc-i2cpld, sm501, tc6393xb, tps65010, ucb1x00, vexpress) - Make use of devm_mfd_* calls (act8945a, as3711, atmel-hlcdc, bcm590xx, hi6421-pmic-core, lp3943, menf21bmc, mt6397, rdc321x, rk808, rn5t618, rt5033, sky81452, stw481x, tps6507x, tps65217, wm8400) Bug Fixes" - Fix ACPI child matching (mfd-core) - Fix start-up ordering issues (mt6397-core, arizona-core) - Fix forgotten register state on resume (intel-lpss) - Fix Clock related issues (twl6040) - Fix scheduling whilst atomic (omap-usb-tll) - Kconfig changes (vexpress)" * tag 'mfd-for-linus-4.7' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (73 commits) mfd: hi655x: Add MFD driver for hi655x mfd: ab8500-debugfs: Trivial fix of spelling mistake on "between" mfd: vexpress: Add !ARCH_USES_GETTIMEOFFSET dependency mfd: Add device-tree binding doc for PMIC MAX77620/MAX20024 mfd: max77620: Add core driver for MAX77620/MAX20024 mfd: arizona: Add defines for GPSW values that can be used from DT mfd: omap-usb-tll: Fix scheduling while atomic BUG mfd: wm5110: ARIZONA_CLOCK_CONTROL should be volatile mfd: axp20x: Add a cell for the ac power_supply part of the axp20x PMICs mfd: intel_soc_pmic_core: Terminate panel control GPIO lookup table correctly mfd: wl1273-core: Use devm_mfd_add_devices() for mfd_device registration mfd: tps65910: Use devm_mfd_add_devices and devm_regmap_add_irq_chip mfd: sec: Use devm_mfd_add_devices and devm_regmap_add_irq_chip mfd: rc5t583: Use devm_mfd_add_devices and devm_request_threaded_irq mfd: max77686: Use devm_mfd_add_devices and devm_regmap_add_irq_chip mfd: as3722: Use devm_mfd_add_devices and devm_regmap_add_irq_chip mfd: twl4030-power: Remove driver path in file comment MAINTAINERS: Add entry for X-Powers AXP family PMIC drivers mfd: smsc-ece1099: Remove unnecessarily remove callback mfd: Use IS_ENABLED(CONFIG_FOO) instead of checking FOO || FOO_MODULE ...
138 lines
4 KiB
C
138 lines
4 KiB
C
/*
|
|
* drivers/mfd/mfd-core.h
|
|
*
|
|
* core MFD support
|
|
* Copyright (c) 2006 Ian Molton
|
|
* Copyright (c) 2007 Dmitry Baryshkov
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License version 2 as
|
|
* published by the Free Software Foundation.
|
|
*
|
|
*/
|
|
|
|
#ifndef MFD_CORE_H
|
|
#define MFD_CORE_H
|
|
|
|
#include <linux/platform_device.h>
|
|
|
|
struct irq_domain;
|
|
struct property_entry;
|
|
|
|
/* Matches ACPI PNP id, either _HID or _CID, or ACPI _ADR */
|
|
struct mfd_cell_acpi_match {
|
|
const char *pnpid;
|
|
const unsigned long long adr;
|
|
};
|
|
|
|
/*
|
|
* This struct describes the MFD part ("cell").
|
|
* After registration the copy of this structure will become the platform data
|
|
* of the resulting platform_device
|
|
*/
|
|
struct mfd_cell {
|
|
const char *name;
|
|
int id;
|
|
|
|
/* refcounting for multiple drivers to use a single cell */
|
|
atomic_t *usage_count;
|
|
int (*enable)(struct platform_device *dev);
|
|
int (*disable)(struct platform_device *dev);
|
|
|
|
int (*suspend)(struct platform_device *dev);
|
|
int (*resume)(struct platform_device *dev);
|
|
|
|
/* platform data passed to the sub devices drivers */
|
|
void *platform_data;
|
|
size_t pdata_size;
|
|
|
|
/* device properties passed to the sub devices drivers */
|
|
struct property_entry *properties;
|
|
|
|
/*
|
|
* Device Tree compatible string
|
|
* See: Documentation/devicetree/usage-model.txt Chapter 2.2 for details
|
|
*/
|
|
const char *of_compatible;
|
|
|
|
/* Matches ACPI */
|
|
const struct mfd_cell_acpi_match *acpi_match;
|
|
|
|
/*
|
|
* These resources can be specified relative to the parent device.
|
|
* For accessing hardware you should use resources from the platform dev
|
|
*/
|
|
int num_resources;
|
|
const struct resource *resources;
|
|
|
|
/* don't check for resource conflicts */
|
|
bool ignore_resource_conflicts;
|
|
|
|
/*
|
|
* Disable runtime PM callbacks for this subdevice - see
|
|
* pm_runtime_no_callbacks().
|
|
*/
|
|
bool pm_runtime_no_callbacks;
|
|
|
|
/* A list of regulator supplies that should be mapped to the MFD
|
|
* device rather than the child device when requested
|
|
*/
|
|
const char * const *parent_supplies;
|
|
int num_parent_supplies;
|
|
};
|
|
|
|
/*
|
|
* Convenience functions for clients using shared cells. Refcounting
|
|
* happens automatically, with the cell's enable/disable callbacks
|
|
* being called only when a device is first being enabled or no other
|
|
* clients are making use of it.
|
|
*/
|
|
extern int mfd_cell_enable(struct platform_device *pdev);
|
|
extern int mfd_cell_disable(struct platform_device *pdev);
|
|
|
|
/*
|
|
* "Clone" multiple platform devices for a single cell. This is to be used
|
|
* for devices that have multiple users of a cell. For example, if an mfd
|
|
* driver wants the cell "foo" to be used by a GPIO driver, an MTD driver,
|
|
* and a platform driver, the following bit of code would be use after first
|
|
* calling mfd_add_devices():
|
|
*
|
|
* const char *fclones[] = { "foo-gpio", "foo-mtd" };
|
|
* err = mfd_clone_cells("foo", fclones, ARRAY_SIZE(fclones));
|
|
*
|
|
* Each driver (MTD, GPIO, and platform driver) would then register
|
|
* platform_drivers for "foo-mtd", "foo-gpio", and "foo", respectively.
|
|
* The cell's .enable/.disable hooks should be used to deal with hardware
|
|
* resource contention.
|
|
*/
|
|
extern int mfd_clone_cell(const char *cell, const char **clones,
|
|
size_t n_clones);
|
|
|
|
/*
|
|
* Given a platform device that's been created by mfd_add_devices(), fetch
|
|
* the mfd_cell that created it.
|
|
*/
|
|
static inline const struct mfd_cell *mfd_get_cell(struct platform_device *pdev)
|
|
{
|
|
return pdev->mfd_cell;
|
|
}
|
|
|
|
extern int mfd_add_devices(struct device *parent, int id,
|
|
const struct mfd_cell *cells, int n_devs,
|
|
struct resource *mem_base,
|
|
int irq_base, struct irq_domain *irq_domain);
|
|
|
|
static inline int mfd_add_hotplug_devices(struct device *parent,
|
|
const struct mfd_cell *cells, int n_devs)
|
|
{
|
|
return mfd_add_devices(parent, PLATFORM_DEVID_AUTO, cells, n_devs,
|
|
NULL, 0, NULL);
|
|
}
|
|
|
|
extern void mfd_remove_devices(struct device *parent);
|
|
|
|
extern int devm_mfd_add_devices(struct device *dev, int id,
|
|
const struct mfd_cell *cells, int n_devs,
|
|
struct resource *mem_base,
|
|
int irq_base, struct irq_domain *irq_domain);
|
|
#endif
|