.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | | - * platform_bcm43xx.c: bcm43xx platform data initilization file |
---|
| 3 | + * platform_bcm43xx.c: bcm43xx platform data initialization file |
---|
3 | 4 | * |
---|
4 | 5 | * (C) Copyright 2016 Intel Corporation |
---|
5 | 6 | * 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. |
---|
11 | 7 | */ |
---|
12 | 8 | |
---|
13 | | -#include <linux/gpio.h> |
---|
| 9 | +#include <linux/gpio/machine.h> |
---|
14 | 10 | #include <linux/platform_device.h> |
---|
15 | 11 | #include <linux/regulator/machine.h> |
---|
16 | 12 | #include <linux/regulator/fixed.h> |
---|
.. | .. |
---|
43 | 39 | * real voltage and signaling are still 1.8V. |
---|
44 | 40 | */ |
---|
45 | 41 | .microvolts = 2000000, /* 1.8V */ |
---|
46 | | - .gpio = -EINVAL, |
---|
47 | 42 | .startup_delay = 250 * 1000, /* 250ms */ |
---|
48 | | - .enable_high = 1, /* active high */ |
---|
49 | 43 | .enabled_at_boot = 0, /* disabled at boot */ |
---|
50 | 44 | .init_data = &bcm43xx_vmmc_data, |
---|
51 | 45 | }; |
---|
.. | .. |
---|
58 | 52 | }, |
---|
59 | 53 | }; |
---|
60 | 54 | |
---|
| 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 | + |
---|
61 | 63 | static int __init bcm43xx_regulator_register(void) |
---|
62 | 64 | { |
---|
| 65 | + struct gpiod_lookup_table *table = &bcm43xx_vmmc_gpio_table; |
---|
| 66 | + struct gpiod_lookup *lookup = table->table; |
---|
63 | 67 | int ret; |
---|
64 | 68 | |
---|
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 | + |
---|
66 | 72 | ret = platform_device_register(&bcm43xx_vmmc_regulator); |
---|
67 | 73 | if (ret) { |
---|
68 | 74 | pr_err("%s: vmmc regulator register failed\n", __func__); |
---|