Merge branch 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[sfrench/cifs-2.6.git] / arch / x86 / platform / intel-mid / device_libs / platform_bcm43xx.c
index 4392c15ed9e0785878bd0498d2eb83b87122e9ac..dbfc5cf2aa9310b62f405bb1cd53fc89a7ad4a00 100644 (file)
@@ -10,7 +10,7 @@
  * of the License.
  */
 
-#include <linux/gpio.h>
+#include <linux/gpio/machine.h>
 #include <linux/platform_device.h>
 #include <linux/regulator/machine.h>
 #include <linux/regulator/fixed.h>
@@ -43,7 +43,6 @@ static struct fixed_voltage_config bcm43xx_vmmc = {
         * real voltage and signaling are still 1.8V.
         */
        .microvolts             = 2000000,              /* 1.8V */
-       .gpio                   = -EINVAL,
        .startup_delay          = 250 * 1000,           /* 250ms */
        .enable_high            = 1,                    /* active high */
        .enabled_at_boot        = 0,                    /* disabled at boot */
@@ -58,11 +57,23 @@ static struct platform_device bcm43xx_vmmc_regulator = {
        },
 };
 
+static struct gpiod_lookup_table bcm43xx_vmmc_gpio_table = {
+       .dev_id = "reg-fixed-voltage.0",
+       .table  = {
+               GPIO_LOOKUP("0000:00:0c.0", -1, NULL, GPIO_ACTIVE_LOW),
+               {}
+       },
+};
+
 static int __init bcm43xx_regulator_register(void)
 {
+       struct gpiod_lookup_table *table = &bcm43xx_vmmc_gpio_table;
+       struct gpiod_lookup *lookup = table->table;
        int ret;
 
-       bcm43xx_vmmc.gpio = get_gpio_by_name(WLAN_SFI_GPIO_ENABLE_NAME);
+       lookup[0].chip_hwnum = get_gpio_by_name(WLAN_SFI_GPIO_ENABLE_NAME);
+       gpiod_add_lookup_table(table);
+
        ret = platform_device_register(&bcm43xx_vmmc_regulator);
        if (ret) {
                pr_err("%s: vmmc regulator register failed\n", __func__);