cleanup regulator supply definitions in mach-omap2 to use REGULATOR_SUPPLY
Subsystems (3)
PATCH 1/1 cleanup regulator supply definitions in mach-omap2 to use REGULATOR_SUPPLY
From: Oleg Drokin <[email protected]>
Also drop old style supply.dev assignments common in hsmmc init as no longer needed.
--- arch/arm/mach-omap2/board-4430sdp.c | 17 ++++----------- arch/arm/mach-omap2/board-cm-t35.c | 12 +++------- arch/arm/mach-omap2/board-ldp.c | 7 +---- arch/arm/mach-omap2/board-omap3beagle.c | 14 +++--------- arch/arm/mach-omap2/board-omap3evm.c | 14 +++--------- arch/arm/mach-omap2/board-omap3logic.c | 7 +---- arch/arm/mach-omap2/board-omap3stalker.c | 14 +++--------- arch/arm/mach-omap2/board-omap3touchbook.c | 14 +++--------- arch/arm/mach-omap2/board-omap4panda.c | 14 +++--------- arch/arm/mach-omap2/board-overo.c | 7 +---- arch/arm/mach-omap2/board-zoom-peripherals.c | 28 +++++++------------------ 11 files changed, 43 insertions(+), 105 deletions(-)
arch/arm/mach-omap2/board-4430sdp.c +5 -12
@@ -331,18 +331,11 @@ static struct omap2_hsmmc_info mmc[] = { {}/* Terminator */ }; -static struct regulator_consumer_supply sdp4430_vaux_supply[] = { - { - .supply ="vmmc" , - .dev_name ="omap_hsmmc.1" , - }, -}; -static struct regulator_consumer_supply sdp4430_vmmc_supply[] = { - { - .supply ="vmmc" , - .dev_name ="omap_hsmmc.0" , - }, -}; +static struct regulator_consumer_supply sdp4430_vaux_supply = + REGULATOR_SUPPLY("vmmc", "omap_hsmmc.1"), + +static struct regulator_consumer_supply sdp4430_vmmc_supply[] = + REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"), static int omap4_twl6030_hsmmc_late_init(struct device *dev) {
arch/arm/mach-omap2/board-cm-t35.c +4 -8
@@ -339,13 +339,11 @@ static void __init cm_t35_init_display(void) } } -static struct regulator_consumer_supply cm_t35_vmmc1_supply = { - .supply ="vmmc" , -}; +static struct regulator_consumer_supply cm_t35_vmmc1_supply = +REGULATOR_SUPPLY ("vmmc" ,"omap_hsmmc.0" ); -static struct regulator_consumer_supply cm_t35_vsim_supply = { - .supply ="vmmc_aux" , -}; +static struct regulator_consumer_supply cm_t35_vsim_supply = +REGULATOR_SUPPLY ("vmmc_aux" ,"omap_hsmmc.0" );static struct regulator_consumer_supply cm_t35_vdac_supply =REGULATOR_SUPPLY ("vdda_dac" ,"omapdss_venc" );
@@ -484,8 +482,6 @@ static int cm_t35_twl_gpio_setup(struct device *dev, unsigned gpio,omap2_hsmmc_init (mmc);/* link regulators to MMC adapters */ - cm_t35_vmmc1_supply.dev = mmc[0 ].dev; - cm_t35_vsim_supply.dev = mmc[0 ].dev;return 0 ; }
arch/arm/mach-omap2/board-ldp.c +2 -5
@@ -213,9 +213,8 @@ static struct twl4030_madc_platform_data ldp_madc_data = { .irq_line = 1, }; -static struct regulator_consumer_supply ldp_vmmc1_supply = { - .supply ="vmmc" , -}; +static struct regulator_consumer_supply ldp_vmmc1_supply = +REGULATOR_SUPPLY ("vmmc" ,"omap_hsmmc.0" );/* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */ static struct regulator_init_data ldp_vmmc1 = {
@@ -341,8 +340,6 @@ static void __init omap_ldp_init(void) ARRAY_SIZE(ldp_nand_partitions), ZOOM_NAND_CS, 0);omap2_hsmmc_init (mmc); -/* link regulators to MMC adapters */ - ldp_vmmc1_supply.dev = mmc[0 ].dev; }MACHINE_START (OMAP_LDP ,"OMAP LDP board" )
arch/arm/mach-omap2/board-omap3beagle.c +4 -10
@@ -238,13 +238,11 @@ static struct omap2_hsmmc_info mmc[] = { {}/* Terminator */ }; -static struct regulator_consumer_supply beagle_vmmc1_supply = { - .supply ="vmmc" , -}; +static struct regulator_consumer_supply beagle_vmmc1_supply = +REGULATOR_SUPPLY ("vmmc" ,"omap_hsmmc.0" ); -static struct regulator_consumer_supply beagle_vsim_supply = { - .supply ="vmmc_aux" , -}; +static struct regulator_consumer_supply beagle_vsim_supply = +REGULATOR_SUPPLY ("vmmc_aux" ,"omap_hsmmc.0" );static struct gpio_led gpio_leds[];
@@ -266,10 +264,6 @@ static int beagle_twl_gpio_setup(struct device *dev, mmc[0 ].gpio_cd = gpio +0 ;omap2_hsmmc_init (mmc); -/* link regulators to MMC adapters */ - beagle_vmmc1_supply.dev = mmc[0 ].dev; - beagle_vsim_supply.dev = mmc[0 ].dev; -/* * TWL4030_GPIO_MAX + 0 == ledA, EHCI nEN_USB_PWR (out, XM active * high / others active low)
arch/arm/mach-omap2/board-omap3evm.c +4 -10
@@ -273,13 +273,11 @@ static struct omap_dss_board_info omap3_evm_dss_data = { .default_device = &omap3_evm_lcd_device, }; -static struct regulator_consumer_supply omap3evm_vmmc1_supply = { - .supply ="vmmc" , -}; +static struct regulator_consumer_supply omap3evm_vmmc1_supply = +REGULATOR_SUPPLY ("vmmc" ,"omap_hsmmc.0" ); -static struct regulator_consumer_supply omap3evm_vsim_supply = { - .supply ="vmmc_aux" , -}; +static struct regulator_consumer_supply omap3evm_vsim_supply = +REGULATOR_SUPPLY ("vmmc_aux" ,"omap_hsmmc.0" );/* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */ static struct regulator_init_data omap3evm_vmmc1 = {
@@ -365,10 +363,6 @@ static int omap3evm_twl_gpio_setup(struct device *dev, mmc[0 ].gpio_cd = gpio +0 ;omap2_hsmmc_init (mmc); -/* link regulators to MMC adapters */ - omap3evm_vmmc1_supply.dev = mmc[0 ].dev; - omap3evm_vsim_supply.dev = mmc[0 ].dev; -/* * Most GPIOs are for USB OTG. Some are mostly sent to * the P2 connector; notably LEDA for the LCD backlight.
arch/arm/mach-omap2/board-omap3logic.c +2 -5
@@ -55,9 +55,8 @@#define OMAP3_TORPEDO_MMC_GPIO_CD 127#define OMAP3_TORPEDO_SMSC911X_GPIO_IRQ 129 -static struct regulator_consumer_supply omap3logic_vmmc1_supply = { - .supply ="vmmc" , -}; +static struct regulator_consumer_supply omap3logic_vmmc1_supply = +REGULATOR_SUPPLY ("vmmc" ,"omap_hsmmc.0" );/* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */ static struct regulator_init_data omap3logic_vmmc1 = {
@@ -130,8 +129,6 @@ static void __init board_mmc_init(void) }omap2_hsmmc_init (board_mmc_info); -/* link regulators to MMC adapters */ - omap3logic_vmmc1_supply.dev = board_mmc_info[0 ].dev; }static struct omap_smsc911x_platform_data __initdata board_smsc911x_data = {
arch/arm/mach-omap2/board-omap3stalker.c +4 -10
@@ -206,13 +206,11 @@ static struct omap_dss_board_info omap3_stalker_dss_data = { .default_device = &omap3_stalker_dvi_device, }; -static struct regulator_consumer_supply omap3stalker_vmmc1_supply = { - .supply ="vmmc" , -}; +static struct regulator_consumer_supply omap3stalker_vmmc1_supply = +REGULATOR_SUPPLY ("vmmc" ,"omap_hsmmc.0" ); -static struct regulator_consumer_supply omap3stalker_vsim_supply = { - .supply ="vmmc_aux" , -}; +static struct regulator_consumer_supply omap3stalker_vsim_supply = +REGULATOR_SUPPLY ("vmmc_aux" ,"omap_hsmmc.0" );/* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */ static struct regulator_init_data omap3stalker_vmmc1 = {
@@ -321,10 +319,6 @@ omap3stalker_twl_gpio_setup(struct device *dev, mmc[0 ].gpio_cd = gpio +0 ;omap2_hsmmc_init (mmc); -/* link regulators to MMC adapters */ - omap3stalker_vmmc1_supply.dev = mmc[0 ].dev; - omap3stalker_vsim_supply.dev = mmc[0 ].dev; -/* * Most GPIOs are for USB OTG. Some are mostly sent to * the P2 connector; notably LEDA for the LCD backlight.
arch/arm/mach-omap2/board-omap3touchbook.c +4 -10
@@ -116,13 +116,11 @@ static struct omap_lcd_config omap3_touchbook_lcd_config __initdata = { .ctrl_name = "internal", }; -static struct regulator_consumer_supply touchbook_vmmc1_supply = { - .supply ="vmmc" , -}; +static struct regulator_consumer_supply touchbook_vmmc1_supply = +REGULATOR_SUPPLY ("vmmc" ,"omap_hsmmc.0" ); -static struct regulator_consumer_supply touchbook_vsim_supply = { - .supply ="vmmc_aux" , -}; +static struct regulator_consumer_supply touchbook_vsim_supply = +REGULATOR_SUPPLY ("vmmc_aux" ,"omap_hsmmc.0" );static struct gpio_led gpio_leds[];
@@ -139,10 +137,6 @@ static int touchbook_twl_gpio_setup(struct device *dev, mmc[0 ].gpio_cd = gpio +0 ;omap2_hsmmc_init (mmc); -/* link regulators to MMC adapters */ - touchbook_vmmc1_supply.dev = mmc[0 ].dev; - touchbook_vsim_supply.dev = mmc[0 ].dev; -/* REVISIT: need ehci-omap hooks for external VBUS * power switch and overcurrent detect */
arch/arm/mach-omap2/board-omap4panda.c +4 -10
@@ -182,17 +182,11 @@ static struct omap2_hsmmc_info mmc[] = { {}/* Terminator */ }; -static struct regulator_consumer_supply omap4_panda_vmmc_supply[] = { - { - .supply ="vmmc" , - .dev_name ="omap_hsmmc.0" , - }, -}; +static struct regulator_consumer_supply omap4_panda_vmmc_supply[] = +REGULATOR_SUPPLY ("vmmc" ,"omap_hsmmc.0" ), -static struct regulator_consumer_supply omap4_panda_vmmc5_supply = { - .supply ="vmmc" , - .dev_name ="omap_hsmmc.4" , -}; +static struct regulator_consumer_supply omap4_panda_vmmc5_supply = +REGULATOR_SUPPLY ("vmmc" ,"omap_hsmmc.4" );static struct regulator_init_data panda_vmmc5 = { .constraints = {
arch/arm/mach-omap2/board-overo.c +2 -5
@@ -321,9 +321,8 @@ static struct omap2_hsmmc_info mmc[] = { {}/* Terminator */ }; -static struct regulator_consumer_supply overo_vmmc1_supply = { - .supply ="vmmc" , -}; +static struct regulator_consumer_supply overo_vmmc1_supply = +REGULATOR_SUPPLY ("vmmc" ,"omap_hsmmc.0" );#if defined(CONFIG_LEDS_GPIO ) || defined(CONFIG_LEDS_GPIO_MODULE )#include <linux/leds.h>
@@ -417,8 +416,6 @@ static int overo_twl_gpio_setup(struct device *dev, {omap2_hsmmc_init (mmc); - overo_vmmc1_supply.dev = mmc[0 ].dev; -#if defined(CONFIG_LEDS_GPIO ) || defined(CONFIG_LEDS_GPIO_MODULE )/* TWL4030_GPIO_MAX + 1 == ledB, PMU_STAT (out, active low LED) */ gpio_leds[2 ].gpio = gpio +TWL4030_GPIO_MAX +1 ;
arch/arm/mach-omap2/board-zoom-peripherals.c +8 -20
@@ -105,22 +105,17 @@ static struct twl4030_keypad_data zoom_kp_twl4030_data = { .rep = 1, }; -static struct regulator_consumer_supply zoom_vmmc1_supply = { - .supply ="vmmc" , -}; +static struct regulator_consumer_supply zoom_vmmc1_supply = +REGULATOR_SUPPLY ("vmmc" ,"omap_hsmmc.0" ); -static struct regulator_consumer_supply zoom_vsim_supply = { - .supply ="vmmc_aux" , -}; +static struct regulator_consumer_supply zoom_vsim_supply = +REGULATOR_SUPPLY ("vmmc_aux" ,"omap_hsmmc.0" ); -static struct regulator_consumer_supply zoom_vmmc2_supply = { - .supply ="vmmc" , -}; +static struct regulator_consumer_supply zoom_vmmc2_supply = +REGULATOR_SUPPLY ("vmmc" ,"omap_hsmmc.1" ); -static struct regulator_consumer_supply zoom_vmmc3_supply = { - .supply ="vmmc" , - .dev_name ="omap_hsmmc.2" , -}; +static struct regulator_consumer_supply zoom_vmmc3_supply = +REGULATOR_SUPPLY ("vmmc" ,"omap_hsmmc.2" );/* VMMC1 for OMAP VDD_MMC1 (i/o) and MMC1 card */ static struct regulator_init_data zoom_vmmc1 = {
@@ -270,13 +265,6 @@ static int zoom_twl_gpio_setup(struct device *dev, mmc[0 ].gpio_cd = gpio +0 ;omap2_hsmmc_init (mmc); -/* link regulators to MMC adapters ... we "know" the -* regulators will be set up only *after* we return. -*/ - zoom_vmmc1_supply.dev = mmc[0 ].dev; - zoom_vsim_supply.dev = mmc[0 ].dev; - zoom_vmmc2_supply.dev = mmc[1 ].dev; - ret =gpio_request_one (LCD_PANEL_ENABLE_GPIO ,GPIOF_OUT_INIT_LOW ,"lcd enable" );if (ret)
Signature · 1 line
1.7.4.4
PATCH 1/1 cleanup regulator supply definitions in mach-omap2 to use REGULATOR_SUPPLY
Quoted 4 lines · green at linuxhacker.ru
From: Oleg Drokin <[email protected]>
Also drop old style supply.dev assignments common in hsmmc init as no longer needed.
Note that it'd be better to split into two patches as it makes review easier.
PATCH 1/1 cleanup regulator supply definitions in mach-omap2 to use REGULATOR_SUPPLY
Hello!
Quoted 2 lines · Mark Brown
Note that it'd be better to split into two patches as it makes review easier.
If I end-up with a new version of the patch, what do you think would be best as a divisor between the patches? Just have ~half of changes split into another patch or do you have any other ideas?
Thanks.
Bye,
Oleg
PATCH 1/1 cleanup regulator supply definitions in mach-omap2 to use REGULATOR_SUPPLY
Quoted 2 lines · Oleg Drokin
If I end-up with a new version of the patch, what do you think would be best as a divisor between the patches? Just have ~half of changes split into another patch or do you have any other ideas?
Split the changes to not set .dev out from the changes to use REGULATOR_SUPPLY(). It's much easier to read big block changes like this when you get a big set of exactly the same change rather than a mix of different changes.