Skip to contentSkip to conversation

ARM: pxa/raumfeld: board support cleanups

PATCH New Daniel Mack 3 participants 6 messages Dec 6, 2009 – Dec 16, 2009

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: pxa/raumfeld: board support cleanups

Some minor things that I didn't notice in the original post.

---
 arch/arm/mach-pxa/raumfeld.c |   53 +++++++++++++++++++----------------------
 1 files changed, 25 insertions(+), 28 deletions(-)
arch/arm/mach-pxa/raumfeld.c +25 -28
index f8457bb..7b33bca 100644
@@ -584,8 +584,6 @@ static struct pxafb_mach_info raumfeld_sharp_lcd_info = {
 	.lcd_conn	= LCD_COLOR_TFT_16BPP | LCD_PCLK_EDGE_FALL,
 };
 
-static int gpio_display_enable = GPIO_DISPLAY_ENABLE;
-
 static void __init raumfeld_lcd_init(void)
 {
 	int ret;
@@ -611,7 +609,7 @@ static void __init raumfeld_lcd_init(void)
 	if (ret < 0)
 		pr_warning("Unable to request GPIO_DISPLAY_ENABLE\n");
 	else
-		gpio_direction_output(gpio_display_enable, 1);
+		gpio_direction_output(GPIO_DISPLAY_ENABLE, 1);
 }
 
 /**
@@ -693,14 +691,23 @@ static struct spi_board_info controller_spi_devices[] __initdata = {
  * MMC for Marvell Libertas 8688 via SDIO
  */
 
-static void raumfeld_mci_setpower(struct device *dev, unsigned int on)
+static int raumfeld_mci_init(struct device *dev, irq_handler_t isr, void *data)
+{
+	gpio_set_value(GPIO_W2W_RESET, 1);
+	gpio_set_value(GPIO_W2W_PDN, 1);
+
+	return 0;
+}
+
+static void raumfeld_mci_exit(struct device *dev, void *data)
 {
-	gpio_set_value(GPIO_W2W_RESET, on);
-	gpio_set_value(GPIO_W2W_PDN, on);
+	gpio_set_value(GPIO_W2W_RESET, 0);
+	gpio_set_value(GPIO_W2W_PDN, 0);
 }
 
 static struct pxamci_platform_data raumfeld_mci_platform_data = {
-	.setpower		= raumfeld_mci_setpower,
+	.init			= raumfeld_mci_init,
+	.exit			= raumfeld_mci_exit,
 	.detect_delay		= 20,
 	.gpio_card_detect	= -1,
 	.gpio_card_ro		= -1,
@@ -711,9 +718,6 @@ static struct pxamci_platform_data raumfeld_mci_platform_data = {
  * External power / charge logic
  */
 
-static int gpio_charge_dc_ok;
-static int gpio_charge_usb_susp;
-
 static int power_supply_init(struct device *dev)
 {
 	return 0;
@@ -725,7 +729,7 @@ static void power_supply_exit(struct device *dev)
 
 static int raumfeld_is_ac_online(void)
 {
-	return !gpio_get_value(gpio_charge_dc_ok);
+	return !gpio_get_value(GPIO_CHARGE_DC_OK);
 }
 
 static int raumfeld_is_usb_online(void)
@@ -787,21 +791,18 @@ static void __init raumfeld_power_init(void)
 	else
 		gpio_direction_output(GPIO_CHRG_PEN2, 1);
 
-	gpio_charge_dc_ok = GPIO_CHARGE_DC_OK;
-	gpio_charge_usb_susp = GPIO_CHARGE_USB_SUSP;
-
-	ret = gpio_request(gpio_charge_dc_ok, "CABLE_DC_OK");
+	ret = gpio_request(GPIO_CHARGE_DC_OK, "CABLE_DC_OK");
 	if (ret < 0)
 		pr_warning("Unable to request GPIO_CHARGE_DC_OK\n");
 
-	ret = gpio_request(gpio_charge_usb_susp, "CHARGE_USB_SUSP");
+	ret = gpio_request(GPIO_CHARGE_USB_SUSP, "CHARGE_USB_SUSP");
 	if (ret < 0)
 		pr_warning("Unable to request GPIO_CHARGE_USB_SUSP\n");
 	else
-		gpio_direction_output(gpio_charge_usb_susp, 0);
+		gpio_direction_output(GPIO_CHARGE_USB_SUSP, 0);
 
-	power_supply_resources[0].start = gpio_to_irq(gpio_charge_dc_ok);
-	power_supply_resources[0].end = gpio_to_irq(gpio_charge_dc_ok);
+	power_supply_resources[0].start = gpio_to_irq(GPIO_CHARGE_DC_OK);
+	power_supply_resources[0].end = gpio_to_irq(GPIO_CHARGE_DC_OK);
 
 	ret = request_irq(gpio_to_irq(GPIO_CHARGE_DONE),
 			&charge_done_irq, IORESOURCE_IRQ_LOWEDGE,
@@ -920,11 +921,9 @@ static struct i2c_board_info raumfeld_pwri2c_board_info = {
 	.platform_data	= &max8660_pdata,
 };
 
-static struct i2c_board_info raumfeld_connector_i2c_board_info[] __initdata = {
-	{
-		.type	= "cs4270",
-		.addr	= 0x48,
-	},
+static struct i2c_board_info raumfeld_connector_i2c_board_info __initdata = {
+	.type	= "cs4270",
+	.addr	= 0x48,
 };
 
 static struct eeti_ts_platform_data eeti_ts_pdata = {
@@ -1040,8 +1039,7 @@ static void __init raumfeld_connector_init(void)
 {
 	pxa3xx_mfp_config(ARRAY_AND_SIZE(raumfeld_connector_pin_config));
 	spi_register_board_info(ARRAY_AND_SIZE(connector_spi_devices));
-	i2c_register_board_info(0,
-			ARRAY_AND_SIZE(raumfeld_connector_i2c_board_info));
+	i2c_register_board_info(0, &raumfeld_connector_i2c_board_info, 1);
 
 	platform_device_register(&smc91x_device);
 
@@ -1053,8 +1051,7 @@ static void __init raumfeld_speaker_init(void)
 {
 	pxa3xx_mfp_config(ARRAY_AND_SIZE(raumfeld_speaker_pin_config));
 	spi_register_board_info(ARRAY_AND_SIZE(speaker_spi_devices));
-	i2c_register_board_info(0,
-			ARRAY_AND_SIZE(raumfeld_connector_i2c_board_info));
+	i2c_register_board_info(0, &raumfeld_connector_i2c_board_info, 1);
 
 	platform_device_register(&smc91x_device);
 	platform_device_register(&rotary_encoder_device);
Signature · 1 line
1.6.5.2
#1 lore raw

PATCH 1/1 ARM: pxa/raumfeld: board support cleanups

Hi Eric,

Quoted 4 lines · Daniel Mack

Some minor things that I didn't notice in the original post.

Would be good if that one made it in, too.

In case your 'pending' branch is not being tracked by anyone, you can also squash this into the original commit if you like.

Thanks,
Daniel

Quoted 138 lines
---
 arch/arm/mach-pxa/raumfeld.c |   53 +++++++++++++++++++----------------------
 1 files changed, 25 insertions(+), 28 deletions(-)
arch/arm/mach-pxa/raumfeld.c +25 -28
index f8457bb..7b33bca 100644
@@ -584,8 +584,6 @@ static struct pxafb_mach_info raumfeld_sharp_lcd_info = {
 	.lcd_conn	= LCD_COLOR_TFT_16BPP | LCD_PCLK_EDGE_FALL,
 };
 
-static int gpio_display_enable = GPIO_DISPLAY_ENABLE;
-
 static void __init raumfeld_lcd_init(void)
 {
 	int ret;
@@ -611,7 +609,7 @@ static void __init raumfeld_lcd_init(void)
 	if (ret < 0)
 		pr_warning("Unable to request GPIO_DISPLAY_ENABLE\n");
 	else
-		gpio_direction_output(gpio_display_enable, 1);
+		gpio_direction_output(GPIO_DISPLAY_ENABLE, 1);
 }
 
 /**
@@ -693,14 +691,23 @@ static struct spi_board_info controller_spi_devices[] __initdata = {
  * MMC for Marvell Libertas 8688 via SDIO
  */
 
-static void raumfeld_mci_setpower(struct device *dev, unsigned int on)
+static int raumfeld_mci_init(struct device *dev, irq_handler_t isr, void *data)
+{
+	gpio_set_value(GPIO_W2W_RESET, 1);
+	gpio_set_value(GPIO_W2W_PDN, 1);
+
+	return 0;
+}
+
+static void raumfeld_mci_exit(struct device *dev, void *data)
 {
-	gpio_set_value(GPIO_W2W_RESET, on);
-	gpio_set_value(GPIO_W2W_PDN, on);
+	gpio_set_value(GPIO_W2W_RESET, 0);
+	gpio_set_value(GPIO_W2W_PDN, 0);
 }
 
 static struct pxamci_platform_data raumfeld_mci_platform_data = {
-	.setpower		= raumfeld_mci_setpower,
+	.init			= raumfeld_mci_init,
+	.exit			= raumfeld_mci_exit,
 	.detect_delay		= 20,
 	.gpio_card_detect	= -1,
 	.gpio_card_ro		= -1,
@@ -711,9 +718,6 @@ static struct pxamci_platform_data raumfeld_mci_platform_data = {
  * External power / charge logic
  */
 
-static int gpio_charge_dc_ok;
-static int gpio_charge_usb_susp;
-
 static int power_supply_init(struct device *dev)
 {
 	return 0;
@@ -725,7 +729,7 @@ static void power_supply_exit(struct device *dev)
 
 static int raumfeld_is_ac_online(void)
 {
-	return !gpio_get_value(gpio_charge_dc_ok);
+	return !gpio_get_value(GPIO_CHARGE_DC_OK);
 }
 
 static int raumfeld_is_usb_online(void)
@@ -787,21 +791,18 @@ static void __init raumfeld_power_init(void)
 	else
 		gpio_direction_output(GPIO_CHRG_PEN2, 1);
 
-	gpio_charge_dc_ok = GPIO_CHARGE_DC_OK;
-	gpio_charge_usb_susp = GPIO_CHARGE_USB_SUSP;
-
-	ret = gpio_request(gpio_charge_dc_ok, "CABLE_DC_OK");
+	ret = gpio_request(GPIO_CHARGE_DC_OK, "CABLE_DC_OK");
 	if (ret < 0)
 		pr_warning("Unable to request GPIO_CHARGE_DC_OK\n");
 
-	ret = gpio_request(gpio_charge_usb_susp, "CHARGE_USB_SUSP");
+	ret = gpio_request(GPIO_CHARGE_USB_SUSP, "CHARGE_USB_SUSP");
 	if (ret < 0)
 		pr_warning("Unable to request GPIO_CHARGE_USB_SUSP\n");
 	else
-		gpio_direction_output(gpio_charge_usb_susp, 0);
+		gpio_direction_output(GPIO_CHARGE_USB_SUSP, 0);
 
-	power_supply_resources[0].start = gpio_to_irq(gpio_charge_dc_ok);
-	power_supply_resources[0].end = gpio_to_irq(gpio_charge_dc_ok);
+	power_supply_resources[0].start = gpio_to_irq(GPIO_CHARGE_DC_OK);
+	power_supply_resources[0].end = gpio_to_irq(GPIO_CHARGE_DC_OK);
 
 	ret = request_irq(gpio_to_irq(GPIO_CHARGE_DONE),
 			&charge_done_irq, IORESOURCE_IRQ_LOWEDGE,
@@ -920,11 +921,9 @@ static struct i2c_board_info raumfeld_pwri2c_board_info = {
 	.platform_data	= &max8660_pdata,
 };
 
-static struct i2c_board_info raumfeld_connector_i2c_board_info[] __initdata = {
-	{
-		.type	= "cs4270",
-		.addr	= 0x48,
-	},
+static struct i2c_board_info raumfeld_connector_i2c_board_info __initdata = {
+	.type	= "cs4270",
+	.addr	= 0x48,
 };
 
 static struct eeti_ts_platform_data eeti_ts_pdata = {
@@ -1040,8 +1039,7 @@ static void __init raumfeld_connector_init(void)
 {
 	pxa3xx_mfp_config(ARRAY_AND_SIZE(raumfeld_connector_pin_config));
 	spi_register_board_info(ARRAY_AND_SIZE(connector_spi_devices));
-	i2c_register_board_info(0,
-			ARRAY_AND_SIZE(raumfeld_connector_i2c_board_info));
+	i2c_register_board_info(0, &raumfeld_connector_i2c_board_info, 1);
 
 	platform_device_register(&smc91x_device);
 
@@ -1053,8 +1051,7 @@ static void __init raumfeld_speaker_init(void)
 {
 	pxa3xx_mfp_config(ARRAY_AND_SIZE(raumfeld_speaker_pin_config));
 	spi_register_board_info(ARRAY_AND_SIZE(speaker_spi_devices));
-	i2c_register_board_info(0,
-			ARRAY_AND_SIZE(raumfeld_connector_i2c_board_info));
+	i2c_register_board_info(0, &raumfeld_connector_i2c_board_info, 1);
 
 	platform_device_register(&smc91x_device);
 	platform_device_register(&rotary_encoder_device);
Signature · 1 line
1.6.5.2
#3 lore raw

PATCH 1/1 ARM: pxa/raumfeld: board support cleanups

Quoted 8 lines · Eric Miao
Quoted 4 lines · Daniel Mack

Some minor things that I didn't notice in the original post.

Merged into 'pending'. Will be pushed out til max8660 stuffs are merged.

Daniel,

Do you know when will max8660 be merged? The window is about to close, but nothing appear to be there about this max8660?

#4 lore raw

PATCH 1/1 ARM: pxa/raumfeld: board support cleanups

Quoted 7 lines · Eric Miao
Quoted 6 lines · Eric Miao
Quoted 4 lines · Daniel Mack

Some minor things that I didn't notice in the original post.

Quoted 7 lines
Quoted 2 lines

Merged into 'pending'. Will be pushed out til max8660 stuffs are merged.

Daniel,

Do you know when will max8660 be merged? The window is about to close, but nothing appear to be there about this max8660?

I don't know. The driver has been queued in regulator-2.6.git:

http://git.kernel.org/?p=linux/kernel/git/broonie/regulator-2.6.git;a=commit;h=9c4d460f13b7d81abb26449a3920638889a3e5ed

Mark, Liam, any idea when things will hit the tree?

Thanks,
Daniel

#5 lore raw

PATCH 1/1 ARM: pxa/raumfeld: board support cleanups

Quoted 13 lines · Daniel Mack
Quoted 12 lines · Eric Miao
Quoted 8 lines · Eric Miao
Quoted 4 lines · Daniel Mack

Some minor things that I didn't notice in the original post.

Merged into 'pending'. Will be pushed out til max8660 stuffs are merged.

Daniel,

Quoted 8 lines
Quoted 2 lines

Do you know when will max8660 be merged? The window is about to close, but nothing appear to be there about this max8660?

I don't know. The driver has been queued in regulator-2.6.git:

http://git.kernel.org/?p=linux/kernel/git/broonie/regulator-2.6.git;a=commit;h=9c4d460f13b7d81abb26449a3920638889a3e5ed

Mark, Liam, any idea when things will hit the tree?

I'll be issuing a pull request tomorrow am.

Sorry about all this, there have been some "issues" lately with the twl pmic rename that have slowed things down with regulator and mfd.

Liam