aboutsummaryrefslogtreecommitdiff
path: root/arch/arm
diff options
context:
space:
mode:
authorBalaji Rao <balajirrao@gmail.com>2008-11-20 19:46:49 +0000
committerAndy Green <agreen@pads.home.warmcat.com>2008-11-20 19:46:49 +0000
commitfa62cc7d002b4422d44f453a08d9cd7c1f192600 (patch)
treec08fa854a795279c98e2b4d7f5fa484975345295 /arch/arm
parentf3e9a706b03391c57b132b7a31f1f4cea4376bc2 (diff)
eliminate_pcf50633_global.patch
Eliminate pcf50633_global and hence make pcf50633.c work with multiple devices. pcf50633 is no longer a paltform device, but an i2c device.
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-s3c2410/include/mach/gta02.h3
-rw-r--r--arch/arm/mach-s3c2440/mach-gta02.c48
-rw-r--r--arch/arm/plat-s3c24xx/neo1973_pm_bt.c8
-rw-r--r--arch/arm/plat-s3c24xx/neo1973_pm_gps.c12
-rw-r--r--arch/arm/plat-s3c24xx/neo1973_pm_gsm.c4
-rw-r--r--arch/arm/plat-s3c24xx/neo1973_pm_host.c4
-rw-r--r--arch/arm/plat-s3c24xx/neo1973_pm_resume_reason.c2
7 files changed, 39 insertions, 42 deletions
diff --git a/arch/arm/mach-s3c2410/include/mach/gta02.h b/arch/arm/mach-s3c2410/include/mach/gta02.h
index 68f853ec2ac..7f103bd2912 100644
--- a/arch/arm/mach-s3c2410/include/mach/gta02.h
+++ b/arch/arm/mach-s3c2410/include/mach/gta02.h
@@ -3,6 +3,7 @@
#include <mach/regs-gpio.h>
#include <mach/irqs.h>
+#include <linux/pcf50633.h>
/* Different hardware revisions, passed in ATAG_REVISION by u-boot */
#define GTA02v1_SYSTEM_REV 0x00000310
@@ -106,4 +107,6 @@
int gta02_get_pcb_revision(void);
+extern struct pcf50633_platform_data gta02_pcf_pdata;
+
#endif /* _GTA02_H */
diff --git a/arch/arm/mach-s3c2440/mach-gta02.c b/arch/arm/mach-s3c2440/mach-gta02.c
index ac2e5b615ef..f0ecc641790 100644
--- a/arch/arm/mach-s3c2440/mach-gta02.c
+++ b/arch/arm/mach-s3c2440/mach-gta02.c
@@ -45,6 +45,8 @@
#include <linux/mtd/partitions.h>
#include <linux/mtd/physmap.h>
+#include <linux/i2c.h>
+
#include <linux/pcf50633.h>
#include <linux/lis302dl.h>
@@ -558,7 +560,7 @@ static struct platform_device gta02_pm_wlan_dev = {
.name = "gta02-pm-wlan",
};
-static struct pcf50633_platform_data gta02_pcf_pdata = {
+struct pcf50633_platform_data gta02_pcf_pdata = {
.used_features = PCF50633_FEAT_MBC |
PCF50633_FEAT_BBC |
PCF50633_FEAT_RTC |
@@ -740,23 +742,6 @@ static void mangle_pmu_pdata_by_system_rev(void)
}
}
-static struct resource gta02_pmu_resources[] = {
- [0] = {
- .flags = IORESOURCE_IRQ,
- .start = GTA02_IRQ_PCF50633,
- .end = GTA02_IRQ_PCF50633,
- },
-};
-
-struct platform_device gta02_pmu_dev = {
- .name = "pcf50633",
- .num_resources = ARRAY_SIZE(gta02_pmu_resources),
- .resource = gta02_pmu_resources,
- .dev = {
- .platform_data = &gta02_pcf_pdata,
- },
-};
-
#ifdef CONFIG_GTA02_HDQ
/* HDQ */
@@ -882,6 +867,14 @@ struct platform_device s3c24xx_pwm_device = {
.num_resources = 0,
};
+static struct i2c_board_info gta02_i2c_devs[] __initdata = {
+ {
+ I2C_BOARD_INFO("pcf50633", 0x73),
+ .irq = GTA02_IRQ_PCF50633,
+ .platform_data = &gta02_pcf_pdata,
+ },
+};
+
static struct s3c2410_nand_set gta02_nand_sets[] = {
[0] = {
.name = "neo1973-nand",
@@ -926,10 +919,10 @@ static void gta02_udc_command(enum s3c2410_udc_cmd_e cmd)
static void gta02_udc_vbus_draw(unsigned int ma)
{
- if (!pcf50633_global)
+ if (!gta02_pcf_pdata.pcf)
return;
- pcf50633_notify_usb_current_limit_change(pcf50633_global, ma);
+ pcf50633_notify_usb_current_limit_change(gta02_pcf_pdata.pcf, ma);
}
static struct s3c2410_udc_mach_info gta02_udc_cfg = {
@@ -977,7 +970,7 @@ static void gta02_jbt6k74_reset(int devidx, int level)
static void gta02_jbt6k74_resuming(int devidx)
{
- pcf50633_backlight_resume(pcf50633_global);
+ pcf50633_backlight_resume(gta02_pcf_pdata.pcf);
}
@@ -1323,7 +1316,7 @@ gta02_glamo_mmc_set_power(unsigned char power_mode, unsigned short vdd)
case MMC_POWER_ON:
case MMC_POWER_UP:
/* depend on pcf50633 driver init + not suspended */
- while (pcf50633_ready(pcf50633_global) && (timeout--))
+ while (pcf50633_ready(gta02_pcf_pdata.pcf) && (timeout--))
msleep(5);
if (timeout < 0) {
@@ -1335,9 +1328,9 @@ gta02_glamo_mmc_set_power(unsigned char power_mode, unsigned short vdd)
if (vdd > 7)
mv += 350 + 100 * (vdd - 8);
printk(KERN_INFO "SD power -> %dmV\n", mv);
- pcf50633_voltage_set(pcf50633_global,
+ pcf50633_voltage_set(gta02_pcf_pdata.pcf,
PCF50633_REGULATOR_HCLDO, mv);
- pcf50633_onoff_set(pcf50633_global,
+ pcf50633_onoff_set(gta02_pcf_pdata.pcf,
PCF50633_REGULATOR_HCLDO, 1);
break;
case MMC_POWER_OFF:
@@ -1346,9 +1339,9 @@ gta02_glamo_mmc_set_power(unsigned char power_mode, unsigned short vdd)
* the action then because pcf50633 suspend already
* dealt with it, otherwise we spin forever
*/
- if (pcf50633_ready(pcf50633_global))
+ if (pcf50633_ready(gta02_pcf_pdata.pcf))
return;
- pcf50633_onoff_set(pcf50633_global,
+ pcf50633_onoff_set(gta02_pcf_pdata.pcf,
PCF50633_REGULATOR_HCLDO, 0);
break;
}
@@ -1511,7 +1504,6 @@ static struct platform_device *gta02_devices[] __initdata = {
&s3c24xx_pwm_device,
&gta02_led_dev,
&gta02_pm_wlan_dev, /* not dependent on PMU */
- &gta02_pmu_dev,
&s3c_device_iis,
&s3c_device_i2c0,
@@ -1593,6 +1585,8 @@ static void __init gta02_machine_init(void)
mangle_glamo_res_by_system_rev();
+ i2c_register_board_info(0, gta02_i2c_devs, ARRAY_SIZE(gta02_i2c_devs));
+
mangle_pmu_pdata_by_system_rev();
platform_add_devices(gta02_devices, ARRAY_SIZE(gta02_devices));
diff --git a/arch/arm/plat-s3c24xx/neo1973_pm_bt.c b/arch/arm/plat-s3c24xx/neo1973_pm_bt.c
index 8be584c9f82..dc149ac6d02 100644
--- a/arch/arm/plat-s3c24xx/neo1973_pm_bt.c
+++ b/arch/arm/plat-s3c24xx/neo1973_pm_bt.c
@@ -88,11 +88,11 @@ static ssize_t bt_write(struct device *dev, struct device_attribute *attr,
if (s3c2410_gpio_getpin(GTA02_GPIO_BT_EN) == on)
return count;
neo1973_gpb_setpin(GTA02_GPIO_BT_EN, !on);
- pcf50633_voltage_set(pcf50633_global,
+ pcf50633_voltage_set(gta02_pcf_pdata.pcf,
PCF50633_REGULATOR_LDO4, on ? 3200 : 0);
- pcf50633_onoff_set(pcf50633_global,
+ pcf50633_onoff_set(gta02_pcf_pdata.pcf,
PCF50633_REGULATOR_LDO4, on);
- vol = pcf50633_voltage_get(pcf50633_global,
+ vol = pcf50633_voltage_get(gta02_pcf_pdata.pcf,
PCF50633_REGULATOR_LDO4);
dev_info(dev, "GTA02 Set PCF50633 LDO4 = %d\n", vol);
neo1973_gpb_setpin(GTA02_GPIO_BT_EN, on);
@@ -158,7 +158,7 @@ static int __init gta01_bt_probe(struct platform_device *pdev)
neo1973_gpb_setpin(GTA01_GPIO_BT_EN, 0);
} else if (machine_is_neo1973_gta02()) {
/* we make sure that the voltage is off */
- pcf50633_onoff_set(pcf50633_global,
+ pcf50633_onoff_set(gta02_pcf_pdata.pcf,
PCF50633_REGULATOR_LDO4, 0);
/* we pull reset to low to make sure that the chip doesn't
* drain power through the reset line */
diff --git a/arch/arm/plat-s3c24xx/neo1973_pm_gps.c b/arch/arm/plat-s3c24xx/neo1973_pm_gps.c
index 6fabf19d0da..a3a6ad3b53f 100644
--- a/arch/arm/plat-s3c24xx/neo1973_pm_gps.c
+++ b/arch/arm/plat-s3c24xx/neo1973_pm_gps.c
@@ -280,7 +280,7 @@ static void gps_pwron_set(int on)
if (machine_is_neo1973_gta02()) {
if (on) {
- pcf50633_voltage_set(pcf50633_global,
+ pcf50633_voltage_set(gta02_pcf_pdata.pcf,
PCF50633_REGULATOR_LDO5, 3000);
/* return UART pins to being UART pins */
s3c2410_gpio_cfgpin(S3C2410_GPH4, S3C2410_GPH4_TXD1);
@@ -296,7 +296,7 @@ static void gps_pwron_set(int on)
/* don't let RX from unpowered GPS float */
s3c2410_gpio_pullup(S3C2410_GPH5, 1);
}
- pcf50633_onoff_set(pcf50633_global,
+ pcf50633_onoff_set(gta02_pcf_pdata.pcf,
PCF50633_REGULATOR_LDO5, on);
}
}
@@ -307,7 +307,7 @@ static int gps_pwron_get(void)
return !!s3c2410_gpio_getpin(GTA01_GPIO_GPS_PWRON);
if (machine_is_neo1973_gta02())
- return !!pcf50633_onoff_get(pcf50633_global,
+ return !!pcf50633_onoff_get(gta02_pcf_pdata.pcf,
PCF50633_REGULATOR_LDO5);
return -1;
}
@@ -630,9 +630,9 @@ static int __init gta01_pm_gps_probe(struct platform_device *pdev)
case GTA02v4_SYSTEM_REV:
case GTA02v5_SYSTEM_REV:
case GTA02v6_SYSTEM_REV:
- pcf50633_voltage_set(pcf50633_global,
+ pcf50633_voltage_set(gta02_pcf_pdata.pcf,
PCF50633_REGULATOR_LDO5, 3000);
- pcf50633_onoff_set(pcf50633_global,
+ pcf50633_onoff_set(gta02_pcf_pdata.pcf,
PCF50633_REGULATOR_LDO5, 0);
dev_info(&pdev->dev, "FIC Neo1973 GPS Power Managerment:"
"starting\n");
@@ -659,7 +659,7 @@ static int gta01_pm_gps_remove(struct platform_device *pdev)
}
if (machine_is_neo1973_gta02()) {
- pcf50633_onoff_set(pcf50633_global, PCF50633_REGULATOR_LDO5, 0);
+ pcf50633_onoff_set(gta02_pcf_pdata.pcf, PCF50633_REGULATOR_LDO5, 0);
sysfs_remove_group(&pdev->dev.kobj, &gta02_gps_attr_group);
}
return 0;
diff --git a/arch/arm/plat-s3c24xx/neo1973_pm_gsm.c b/arch/arm/plat-s3c24xx/neo1973_pm_gsm.c
index 7dd28911904..ebed33558a7 100644
--- a/arch/arm/plat-s3c24xx/neo1973_pm_gsm.c
+++ b/arch/arm/plat-s3c24xx/neo1973_pm_gsm.c
@@ -117,7 +117,7 @@ static ssize_t gsm_write(struct device *dev, struct device_attribute *attr,
case GTA02v4_SYSTEM_REV:
case GTA02v5_SYSTEM_REV:
case GTA02v6_SYSTEM_REV:
- pcf50633_gpio_set(pcf50633_global,
+ pcf50633_gpio_set(gta02_pcf_pdata.pcf,
PCF50633_GPIO2, 1);
break;
}
@@ -134,7 +134,7 @@ static ssize_t gsm_write(struct device *dev, struct device_attribute *attr,
case GTA02v4_SYSTEM_REV:
case GTA02v5_SYSTEM_REV:
case GTA02v6_SYSTEM_REV:
- pcf50633_gpio_set(pcf50633_global,
+ pcf50633_gpio_set(gta02_pcf_pdata.pcf,
PCF50633_GPIO2, 0);
break;
}
diff --git a/arch/arm/plat-s3c24xx/neo1973_pm_host.c b/arch/arm/plat-s3c24xx/neo1973_pm_host.c
index bb25acdb7d2..8ab589b3ad8 100644
--- a/arch/arm/plat-s3c24xx/neo1973_pm_host.c
+++ b/arch/arm/plat-s3c24xx/neo1973_pm_host.c
@@ -27,7 +27,7 @@ static ssize_t pm_host_read(struct device *dev, struct device_attribute *attr,
char *buf)
{
return sprintf(buf, "%d\n",
- pcf50633_gpio_get(pcf50633_global, PCF50633_GPO));
+ pcf50633_gpio_get(gta02_pcf_pdata.pcf, PCF50633_GPO));
}
static ssize_t pm_host_write(struct device *dev, struct device_attribute *attr,
@@ -35,7 +35,7 @@ static ssize_t pm_host_write(struct device *dev, struct device_attribute *attr,
{
unsigned long on = simple_strtoul(buf, NULL, 10);
- pcf50633_gpio_set(pcf50633_global, PCF50633_GPO, on);
+ pcf50633_gpio_set(gta02_pcf_pdata.pcf, PCF50633_GPO, on);
return count;
}
diff --git a/arch/arm/plat-s3c24xx/neo1973_pm_resume_reason.c b/arch/arm/plat-s3c24xx/neo1973_pm_resume_reason.c
index c7730b60da9..a04466c8960 100644
--- a/arch/arm/plat-s3c24xx/neo1973_pm_resume_reason.c
+++ b/arch/arm/plat-s3c24xx/neo1973_pm_resume_reason.c
@@ -80,7 +80,7 @@ static ssize_t resume_reason_read(struct device *dev,
#ifdef CONFIG_MACH_NEO1973_GTA02
if ((gta) && (bit == 9)) /* PMU */
- end += pcf50633_report_resumers(pcf50633_global, end);
+ end += pcf50633_report_resumers(gta02_pcf_pdata.pcf, end);
#endif
}