mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-25 14:13:01 -04:00
Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6
* 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6: mfd: Clean up max8997 IRQ namespace mfd: Fold irq_set_chip/irq_set_handler mfd: Cleanup irq namespace mfd: twl6030: Cleanup interrupt handling mfd: twl4030: Cleanup interrupt handling mfd: mx8925: Remove irq_desc leftovers mfd: htc-i2cpld: Cleanup interrupt handling mfd: htc-egpio: Cleanup interrupt handling mfd: ezx-pcap: Remvove open coded irq handling mfd: 88pm860x: Remove unused irq_desc leftovers mfd: asic3: Cleanup irq handling mfd: Select MFD_CORE if TPS6105X driver is configured mfd: Add MODULE_DEVICE_TABLE to rdc321x-southbridge mfd: Add MAX8997/8966 IRQ control mfd: Constify i2c_device_id tables mfd: OLPC: Clean up names to match what OLPC actually uses mfd: Add mfd_clone_cell(), convert cs5535-mfd/olpc-xo1 to it
This commit is contained in:
commit
551b0bda46
33 changed files with 618 additions and 302 deletions
|
|
@ -62,6 +62,24 @@ struct mfd_cell {
|
|||
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.
|
||||
|
|
@ -87,13 +105,4 @@ extern int mfd_add_devices(struct device *parent, int id,
|
|||
|
||||
extern void mfd_remove_devices(struct device *parent);
|
||||
|
||||
/*
|
||||
* For MFD drivers with clients sharing access to resources, these create
|
||||
* multiple platform devices per cell. Contention handling must still be
|
||||
* handled via drivers (ie, with enable/disable hooks).
|
||||
*/
|
||||
extern int mfd_shared_platform_driver_register(struct platform_driver *drv,
|
||||
const char *cellname);
|
||||
extern void mfd_shared_platform_driver_unregister(struct platform_driver *drv);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -24,6 +24,8 @@
|
|||
|
||||
#include <linux/i2c.h>
|
||||
|
||||
#define MAX8997_REG_INVALID (0xff)
|
||||
|
||||
enum max8997_pmic_reg {
|
||||
MAX8997_REG_PMIC_ID0 = 0x00,
|
||||
MAX8997_REG_PMIC_ID1 = 0x01,
|
||||
|
|
@ -313,6 +315,7 @@ enum max8997_irq {
|
|||
#define MAX8997_REG_BUCK2DVS(x) (MAX8997_REG_BUCK2DVS1 + (x) - 1)
|
||||
#define MAX8997_REG_BUCK5DVS(x) (MAX8997_REG_BUCK5DVS1 + (x) - 1)
|
||||
|
||||
#define MAX8997_NUM_GPIO 12
|
||||
struct max8997_dev {
|
||||
struct device *dev;
|
||||
struct i2c_client *i2c; /* 0xcc / PMIC, Battery Control, and FLASH */
|
||||
|
|
@ -324,11 +327,19 @@ struct max8997_dev {
|
|||
int type;
|
||||
struct platform_device *battery; /* battery control (not fuel gauge) */
|
||||
|
||||
int irq;
|
||||
int ono;
|
||||
int irq_base;
|
||||
bool wakeup;
|
||||
struct mutex irqlock;
|
||||
int irq_masks_cur[MAX8997_IRQ_GROUP_NR];
|
||||
int irq_masks_cache[MAX8997_IRQ_GROUP_NR];
|
||||
|
||||
/* For hibernation */
|
||||
u8 reg_dump[MAX8997_REG_PMIC_END + MAX8997_MUIC_REG_END +
|
||||
MAX8997_HAPTIC_REG_END];
|
||||
|
||||
bool gpio_status[MAX8997_NUM_GPIO];
|
||||
};
|
||||
|
||||
enum max8997_types {
|
||||
|
|
@ -336,6 +347,10 @@ enum max8997_types {
|
|||
TYPE_MAX8966,
|
||||
};
|
||||
|
||||
extern int max8997_irq_init(struct max8997_dev *max8997);
|
||||
extern void max8997_irq_exit(struct max8997_dev *max8997);
|
||||
extern int max8997_irq_resume(struct max8997_dev *max8997);
|
||||
|
||||
extern int max8997_read_reg(struct i2c_client *i2c, u8 reg, u8 *dest);
|
||||
extern int max8997_bulk_read(struct i2c_client *i2c, u8 reg, int count,
|
||||
u8 *buf);
|
||||
|
|
@ -344,4 +359,10 @@ extern int max8997_bulk_write(struct i2c_client *i2c, u8 reg, int count,
|
|||
u8 *buf);
|
||||
extern int max8997_update_reg(struct i2c_client *i2c, u8 reg, u8 val, u8 mask);
|
||||
|
||||
#define MAX8997_GPIO_INT_BOTH (0x3 << 4)
|
||||
#define MAX8997_GPIO_INT_RISE (0x2 << 4)
|
||||
#define MAX8997_GPIO_INT_FALL (0x1 << 4)
|
||||
|
||||
#define MAX8997_GPIO_INT_MASK (0x3 << 4)
|
||||
#define MAX8997_GPIO_DATA_MASK (0x1 << 2)
|
||||
#endif /* __LINUX_MFD_MAX8997_PRIV_H */
|
||||
|
|
|
|||
|
|
@ -78,8 +78,11 @@ struct max8997_regulator_data {
|
|||
};
|
||||
|
||||
struct max8997_platform_data {
|
||||
bool wakeup;
|
||||
/* IRQ: Not implemented */
|
||||
/* IRQ */
|
||||
int irq_base;
|
||||
int ono;
|
||||
int wakeup;
|
||||
|
||||
/* ---- PMIC ---- */
|
||||
struct max8997_regulator_data *regulators;
|
||||
int num_regulators;
|
||||
|
|
|
|||
Loading…
Reference in a new issue