| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * linux/arch/arm/mach-mmp/brownstone.c |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Support for the Marvell Brownstone Development Platform. |
|---|
| 5 | 6 | * |
|---|
| 6 | 7 | * 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. |
|---|
| 11 | 8 | */ |
|---|
| 12 | 9 | |
|---|
| 13 | 10 | #include <linux/init.h> |
|---|
| .. | .. |
|---|
| 15 | 12 | #include <linux/platform_device.h> |
|---|
| 16 | 13 | #include <linux/io.h> |
|---|
| 17 | 14 | #include <linux/gpio-pxa.h> |
|---|
| 15 | +#include <linux/gpio/machine.h> |
|---|
| 18 | 16 | #include <linux/regulator/machine.h> |
|---|
| 19 | 17 | #include <linux/regulator/max8649.h> |
|---|
| 20 | 18 | #include <linux/regulator/fixed.h> |
|---|
| .. | .. |
|---|
| 148 | 146 | static struct fixed_voltage_config brownstone_v_5vp = { |
|---|
| 149 | 147 | .supply_name = "v_5vp", |
|---|
| 150 | 148 | .microvolts = 5000000, |
|---|
| 151 | | - .gpio = GPIO_5V_ENABLE, |
|---|
| 152 | | - .enable_high = 1, |
|---|
| 153 | 149 | .enabled_at_boot = 1, |
|---|
| 154 | 150 | .init_data = &brownstone_v_5vp_data, |
|---|
| 155 | 151 | }; |
|---|
| .. | .. |
|---|
| 159 | 155 | .id = 1, |
|---|
| 160 | 156 | .dev = { |
|---|
| 161 | 157 | .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 | + { }, |
|---|
| 162 | 167 | }, |
|---|
| 163 | 168 | }; |
|---|
| 164 | 169 | |
|---|
| .. | .. |
|---|
| 217 | 222 | mmp2_add_isram(&mmp2_isram_platdata); |
|---|
| 218 | 223 | |
|---|
| 219 | 224 | /* enable 5v regulator */ |
|---|
| 225 | + gpiod_add_lookup_table(&brownstone_v_5vp_gpiod_table); |
|---|
| 220 | 226 | platform_device_register(&brownstone_v_5vp_device); |
|---|
| 221 | 227 | } |
|---|
| 222 | 228 | |
|---|