diff options
author | Xiexiaobo <X.Xie@freescale.com> | 2009-05-31 17:28:28 +0800 |
---|---|---|
committer | Xiexiaobo <X.Xie@freescale.com> | 2009-06-02 13:46:32 +0800 |
commit | e73cee2c8c1302792b49b837c80ce81590ae97d8 (patch) | |
tree | 109c770a02644d7da57cfb10c1bfaa17dd3d2dc9 /drivers/mxc | |
parent | 1e7276a7866a3a329507a68c8e2bad60e0f5305a (diff) |
ENGR00112635-1 Port MC34704 regulator driver to kernel-2.6.28
Port MC34704 regulator driver to kernel-2.6.28.
Signed-off-by: Xie Xiaobo <X.Xie@freescale.com>
Diffstat (limited to 'drivers/mxc')
-rw-r--r-- | drivers/mxc/pmic/Kconfig | 7 | ||||
-rw-r--r-- | drivers/mxc/pmic/core/mc34704.c | 19 |
2 files changed, 17 insertions, 9 deletions
diff --git a/drivers/mxc/pmic/Kconfig b/drivers/mxc/pmic/Kconfig index 1332e2614c00..d2273996cb2c 100644 --- a/drivers/mxc/pmic/Kconfig +++ b/drivers/mxc/pmic/Kconfig @@ -45,13 +45,6 @@ config MXC_PMIC_MC9SDZ60 ---help--- This is the MXC MC9sDZ60(MCU) PMIC support. -config MXC_PMIC_MC34704 - tristate "MC34704 PMIC" - depends on ARCH_MXC && I2C - select MXC_PMIC - ---help--- - This is the MXC MC34704 PMIC support. - config MXC_PMIC_CHARDEV tristate "MXC PMIC device interface" depends on MXC_PMIC diff --git a/drivers/mxc/pmic/core/mc34704.c b/drivers/mxc/pmic/core/mc34704.c index b6b18ad50319..f0ec05afe0ab 100644 --- a/drivers/mxc/pmic/core/mc34704.c +++ b/drivers/mxc/pmic/core/mc34704.c @@ -29,6 +29,7 @@ #include <linux/interrupt.h> #include <linux/i2c.h> #include <linux/uaccess.h> +#include <linux/mfd/mc34704/core.h> #include <linux/pmic_external.h> #include <linux/pmic_status.h> @@ -236,12 +237,25 @@ static int __devinit pmic_probe(struct i2c_client *client, const struct i2c_device_id *id) { int ret = 0; + struct mc34704 *mc34704; + struct mc34704_platform_data *plat_data = client->dev.platform_data; + + if (!plat_data || !plat_data->init) + return -ENODEV; ret = is_chip_onboard(client); if (ret == -1) return -ENODEV; + mc34704 = kzalloc(sizeof(struct mc34704), GFP_KERNEL); + if (mc34704 == NULL) + return -ENOMEM; + + i2c_set_clientdata(client, mc34704); + mc34704->dev = &client->dev; + mc34704->i2c_client = client; + mc34704_client = client; /* Initialize the PMIC event handling */ @@ -251,8 +265,9 @@ static int __devinit pmic_probe(struct i2c_client *client, if (pmic_init_registers() != PMIC_SUCCESS) return PMIC_ERROR; - /* Tickle the regulator driver */ - reg_mc34704_probe(); + ret = plat_data->init(mc34704); + if (ret != 0) + return PMIC_ERROR; dev_info(&client->dev, "Loaded\n"); |