forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-10 748e4f3d702def1a4bff191e0cf93b6a05340f01
kernel/arch/arm/mach-mmp/brownstone.c
....@@ -1,13 +1,10 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * linux/arch/arm/mach-mmp/brownstone.c
34 *
45 * Support for the Marvell Brownstone Development Platform.
56 *
67 * Copyright (C) 2009-2010 Marvell International Ltd.
7
- *
8
- * This program is free software; you can redistribute it and/or modify
9
- * it under the terms of the GNU General Public License version 2 as
10
- * publishhed by the Free Software Foundation.
118 */
129
1310 #include <linux/init.h>
....@@ -15,6 +12,7 @@
1512 #include <linux/platform_device.h>
1613 #include <linux/io.h>
1714 #include <linux/gpio-pxa.h>
15
+#include <linux/gpio/machine.h>
1816 #include <linux/regulator/machine.h>
1917 #include <linux/regulator/max8649.h>
2018 #include <linux/regulator/fixed.h>
....@@ -148,8 +146,6 @@
148146 static struct fixed_voltage_config brownstone_v_5vp = {
149147 .supply_name = "v_5vp",
150148 .microvolts = 5000000,
151
- .gpio = GPIO_5V_ENABLE,
152
- .enable_high = 1,
153149 .enabled_at_boot = 1,
154150 .init_data = &brownstone_v_5vp_data,
155151 };
....@@ -159,6 +155,15 @@
159155 .id = 1,
160156 .dev = {
161157 .platform_data = &brownstone_v_5vp,
158
+ },
159
+};
160
+
161
+static struct gpiod_lookup_table brownstone_v_5vp_gpiod_table = {
162
+ .dev_id = "reg-fixed-voltage.1", /* .id set to 1 above */
163
+ .table = {
164
+ GPIO_LOOKUP("gpio-pxa", GPIO_5V_ENABLE,
165
+ NULL, GPIO_ACTIVE_HIGH),
166
+ { },
162167 },
163168 };
164169
....@@ -217,6 +222,7 @@
217222 mmp2_add_isram(&mmp2_isram_platdata);
218223
219224 /* enable 5v regulator */
225
+ gpiod_add_lookup_table(&brownstone_v_5vp_gpiod_table);
220226 platform_device_register(&brownstone_v_5vp_device);
221227 }
222228