Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit e536700e authored by Mark Brown's avatar Mark Brown
Browse files

regulator: gpio: Revert



regulator: fixed/gpio: Revert GPIO descriptor changes due to platform breakage

Commit 6059577c "regulator: fixed: Convert to use GPIO descriptor
only" broke at least the ams-delta platform since the lookup tables
added to the board files use the function name "enable" while the driver
uses NULL causing the regulator to not acquire and control the enable
GPIOs.  Revert that and a couple of other commits that are caught up
with it to fix the issue:

2b6c00c1 "ARM: pxa, regulator: fix building ezx e680"
6059577c "regulator: fixed: Convert to use GPIO descriptor only"
37bed97f "regulator: gpio: Get enable GPIO using GPIO descriptor"

Reported-by: default avatarJanusz Krzysztofik <jmkrzyszt@gmail.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 2b6c00c1
Loading
Loading
Loading
Loading
+1 −12
Original line number Diff line number Diff line
@@ -18,7 +18,6 @@
#include <linux/mtd/mtd.h>
#include <linux/mtd/physmap.h>
#include <linux/gpio/driver.h>
#include <linux/gpio/machine.h>
#include <linux/gpio.h>
#include <linux/regulator/fixed.h>
#include <linux/regulator/machine.h>
@@ -176,7 +175,6 @@ static struct resource mx21ads_mmgpio_resource =
	DEFINE_RES_MEM_NAMED(MX21ADS_IO_REG, SZ_2, "dat");

static struct bgpio_pdata mx21ads_mmgpio_pdata = {
	.label	= "mx21ads-mmgpio",
	.base	= MX21ADS_MMGPIO_BASE,
	.ngpio	= 16,
};
@@ -205,6 +203,7 @@ static struct regulator_init_data mx21ads_lcd_regulator_init_data = {
static struct fixed_voltage_config mx21ads_lcd_regulator_pdata = {
	.supply_name	= "LCD",
	.microvolts	= 3300000,
	.gpio		= MX21ADS_IO_LCDON,
	.enable_high	= 1,
	.init_data	= &mx21ads_lcd_regulator_init_data,
};
@@ -217,15 +216,6 @@ static struct platform_device mx21ads_lcd_regulator = {
	},
};

static struct gpiod_lookup_table mx21ads_lcd_regulator_gpiod_table = {
	.dev_id = "reg-fixed-voltage.0", /* Let's hope ID 0 is what we get */
	.table = {
		GPIO_LOOKUP("mx21ads-mmgpio", 9,
			    "enable", GPIO_ACTIVE_HIGH),
		{ },
	},
};

/*
 * Connected is a portrait Sharp-QVGA display
 * of type: LQ035Q7DB02
@@ -321,7 +311,6 @@ static void __init mx21ads_late_init(void)
{
	imx21_add_mxc_mmc(0, &mx21ads_sdhc_pdata);

	gpiod_add_lookup_table(&mx21ads_lcd_regulator_gpiod_table);
	platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices));

	mx21ads_cs8900_resources[1].start =
+1 −11
Original line number Diff line number Diff line
@@ -16,7 +16,6 @@
#include <linux/gpio/driver.h>
/* Needed for gpio_to_irq() */
#include <linux/gpio.h>
#include <linux/gpio/machine.h>
#include <linux/platform_device.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/map.h>
@@ -231,17 +230,10 @@ static struct regulator_init_data mx27ads_lcd_regulator_init_data = {
static struct fixed_voltage_config mx27ads_lcd_regulator_pdata = {
	.supply_name	= "LCD",
	.microvolts	= 3300000,
	.gpio		= MX27ADS_LCD_GPIO,
	.init_data	= &mx27ads_lcd_regulator_init_data,
};

static struct gpiod_lookup_table mx27ads_lcd_regulator_gpiod_table = {
	.dev_id = "reg-fixed-voltage.0", /* Let's hope ID 0 is what we get */
	.table = {
		GPIO_LOOKUP("LCD", 0, "enable", GPIO_ACTIVE_HIGH),
		{ },
	},
};

static void __init mx27ads_regulator_init(void)
{
	struct gpio_chip *vchip;
@@ -255,8 +247,6 @@ static void __init mx27ads_regulator_init(void)
	vchip->set		= vgpio_set;
	gpiochip_add_data(vchip, NULL);

	gpiod_add_lookup_table(&mx27ads_lcd_regulator_gpiod_table);

	platform_device_register_data(NULL, "reg-fixed-voltage",
				      PLATFORM_DEVID_AUTO,
				      &mx27ads_lcd_regulator_pdata,
+1 −11
Original line number Diff line number Diff line
@@ -15,7 +15,6 @@
#include <linux/platform_device.h>
#include <linux/io.h>
#include <linux/gpio-pxa.h>
#include <linux/gpio/machine.h>
#include <linux/regulator/machine.h>
#include <linux/regulator/max8649.h>
#include <linux/regulator/fixed.h>
@@ -149,6 +148,7 @@ static struct regulator_init_data brownstone_v_5vp_data = {
static struct fixed_voltage_config brownstone_v_5vp = {
	.supply_name		= "v_5vp",
	.microvolts		= 5000000,
	.gpio			= GPIO_5V_ENABLE,
	.enable_high		= 1,
	.enabled_at_boot	= 1,
	.init_data		= &brownstone_v_5vp_data,
@@ -162,15 +162,6 @@ static struct platform_device brownstone_v_5vp_device = {
	},
};

static struct gpiod_lookup_table brownstone_v_5vp_gpiod_table = {
	.dev_id = "reg-fixed-voltage.1", /* .id set to 1 above */
	.table = {
		GPIO_LOOKUP("gpio-pxa", GPIO_5V_ENABLE,
			    "enable", GPIO_ACTIVE_HIGH),
		{ },
	},
};

static struct max8925_platform_data brownstone_max8925_info = {
	.irq_base		= MMP_NR_IRQS,
};
@@ -226,7 +217,6 @@ static void __init brownstone_init(void)
	mmp2_add_isram(&mmp2_isram_platdata);

	/* enable 5v regulator */
	gpiod_add_lookup_table(&brownstone_v_5vp_gpiod_table);
	platform_device_register(&brownstone_v_5vp_device);
}

+1 −13
Original line number Diff line number Diff line
@@ -12,7 +12,6 @@
 * published by the Free Software Foundation.
 */
#include <linux/gpio/driver.h>
#include <linux/gpio/machine.h>
#include <linux/gpio.h>
#include <linux/kernel.h>
#include <linux/init.h>
@@ -204,7 +203,6 @@ static struct resource latch2_resources[] = {
};

static struct bgpio_pdata latch2_pdata = {
	.label	= "ams-delta-latch2",
	.base	= AMS_DELTA_LATCH2_GPIO_BASE,
	.ngpio	= AMS_DELTA_LATCH2_NGPIO,
};
@@ -274,6 +272,7 @@ static struct regulator_init_data modem_nreset_data = {
static struct fixed_voltage_config modem_nreset_config = {
	.supply_name		= "modem_nreset",
	.microvolts		= 3300000,
	.gpio			= AMS_DELTA_GPIO_PIN_MODEM_NRESET,
	.startup_delay		= 25000,
	.enable_high		= 1,
	.enabled_at_boot	= 1,
@@ -288,16 +287,6 @@ static struct platform_device modem_nreset_device = {
	},
};

static struct gpiod_lookup_table modem_nreset_gpiod_table = {
	.dev_id = "reg-fixed-voltage",
	.table = {
		/* The AMS_DELTA_GPIO_PIN_MODEM_NRESET is at offset 12 */
		GPIO_LOOKUP("ams-delta-latch2", 12,
			    "enable", GPIO_ACTIVE_HIGH),
		{ },
	},
};

struct modem_private_data {
	struct regulator *regulator;
};
@@ -581,7 +570,6 @@ static int __init late_init(void)

	platform_add_devices(late_devices, ARRAY_SIZE(late_devices));

	gpiod_add_lookup_table(&modem_nreset_gpiod_table);
	err = platform_device_register(&modem_nreset_device);
	if (err) {
		pr_err("Couldn't register the modem regulator device\n");
+1 −15
Original line number Diff line number Diff line
@@ -10,7 +10,6 @@
#include <linux/clk.h>
#include <linux/davinci_emac.h>
#include <linux/gpio.h>
#include <linux/gpio/machine.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/of_platform.h>
@@ -331,6 +330,7 @@ static struct regulator_init_data pandora_vmmc3 = {
static struct fixed_voltage_config pandora_vwlan = {
	.supply_name		= "vwlan",
	.microvolts		= 1800000, /* 1.8V */
	.gpio			= PANDORA_WIFI_NRESET_GPIO,
	.startup_delay		= 50000, /* 50ms */
	.enable_high		= 1,
	.init_data		= &pandora_vmmc3,
@@ -344,19 +344,6 @@ static struct platform_device pandora_vwlan_device = {
	},
};

static struct gpiod_lookup_table pandora_vwlan_gpiod_table = {
	.dev_id = "reg-fixed-voltage.1",
	.table = {
		/*
		 * As this is a low GPIO number it should be at the first
		 * GPIO bank.
		 */
		GPIO_LOOKUP("gpio-0-31", PANDORA_WIFI_NRESET_GPIO,
			    "enable", GPIO_ACTIVE_HIGH),
		{ },
	},
};

static void pandora_wl1251_init_card(struct mmc_card *card)
{
	/*
@@ -418,7 +405,6 @@ static void __init pandora_wl1251_init(void)
static void __init omap3_pandora_legacy_init(void)
{
	platform_device_register(&pandora_backlight);
	gpiod_add_lookup_table(&pandora_vwlan_gpiod_table);
	platform_device_register(&pandora_vwlan_device);
	omap_hsmmc_init(pandora_mmc3);
	omap_hsmmc_late_init(pandora_mmc3);
Loading