hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/arch/x86/platform/intel-mid/device_libs/platform_bcm43xx.c
....@@ -1,16 +1,12 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
2
- * platform_bcm43xx.c: bcm43xx platform data initilization file
3
+ * platform_bcm43xx.c: bcm43xx platform data initialization file
34 *
45 * (C) Copyright 2016 Intel Corporation
56 * Author: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
6
- *
7
- * This program is free software; you can redistribute it and/or
8
- * modify it under the terms of the GNU General Public License
9
- * as published by the Free Software Foundation; version 2
10
- * of the License.
117 */
128
13
-#include <linux/gpio.h>
9
+#include <linux/gpio/machine.h>
1410 #include <linux/platform_device.h>
1511 #include <linux/regulator/machine.h>
1612 #include <linux/regulator/fixed.h>
....@@ -43,9 +39,7 @@
4339 * real voltage and signaling are still 1.8V.
4440 */
4541 .microvolts = 2000000, /* 1.8V */
46
- .gpio = -EINVAL,
4742 .startup_delay = 250 * 1000, /* 250ms */
48
- .enable_high = 1, /* active high */
4943 .enabled_at_boot = 0, /* disabled at boot */
5044 .init_data = &bcm43xx_vmmc_data,
5145 };
....@@ -58,11 +52,23 @@
5852 },
5953 };
6054
55
+static struct gpiod_lookup_table bcm43xx_vmmc_gpio_table = {
56
+ .dev_id = "reg-fixed-voltage.0",
57
+ .table = {
58
+ GPIO_LOOKUP("0000:00:0c.0", -1, NULL, GPIO_ACTIVE_LOW),
59
+ {}
60
+ },
61
+};
62
+
6163 static int __init bcm43xx_regulator_register(void)
6264 {
65
+ struct gpiod_lookup_table *table = &bcm43xx_vmmc_gpio_table;
66
+ struct gpiod_lookup *lookup = table->table;
6367 int ret;
6468
65
- bcm43xx_vmmc.gpio = get_gpio_by_name(WLAN_SFI_GPIO_ENABLE_NAME);
69
+ lookup[0].chip_hwnum = get_gpio_by_name(WLAN_SFI_GPIO_ENABLE_NAME);
70
+ gpiod_add_lookup_table(table);
71
+
6672 ret = platform_device_register(&bcm43xx_vmmc_regulator);
6773 if (ret) {
6874 pr_err("%s: vmmc regulator register failed\n", __func__);