1 // SPDX-License-Identifier: GPL-2.0-only
3 * linux/arch/arm/mach-mmp/jasper.c
5 * Support for the Marvell Jasper Development Platform.
7 * Copyright (C) 2009-2010 Marvell International Ltd.
10 #include <linux/init.h>
11 #include <linux/kernel.h>
12 #include <linux/gpio-pxa.h>
13 #include <linux/platform_device.h>
15 #include <linux/regulator/machine.h>
16 #include <linux/regulator/max8649.h>
17 #include <linux/mfd/max8925.h>
18 #include <linux/interrupt.h>
21 #include <asm/mach-types.h>
22 #include <asm/mach/arch.h>
29 #define JASPER_NR_IRQS (MMP_NR_IRQS + 48)
31 static unsigned long jasper_pin_config
[] __initdata
= {
67 PMIC_PMIC_INT
| MFP_LPM_EDGE_FALL
,
100 static struct pxa_gpio_platform_data mmp2_gpio_pdata
= {
101 .irq_base
= MMP_GPIO_TO_IRQ(0),
104 static struct regulator_consumer_supply max8649_supply
[] = {
105 REGULATOR_SUPPLY("vcc_core", NULL
),
108 static struct regulator_init_data max8649_init_data
= {
110 .name
= "vcc_core range",
115 .valid_ops_mask
= REGULATOR_CHANGE_VOLTAGE
,
117 .num_consumer_supplies
= 1,
118 .consumer_supplies
= &max8649_supply
[0],
121 static struct max8649_platform_data jasper_max8649_info
= {
122 .mode
= 2, /* VID1 = 1, VID0 = 0 */
124 .ramp_timing
= MAX8649_RAMP_32MV
,
125 .regulator
= &max8649_init_data
,
128 static struct max8925_backlight_pdata jasper_backlight_data
= {
132 static struct max8925_power_pdata jasper_power_data
= {
133 .batt_detect
= 0, /* can't detect battery by ID pin */
134 .topoff_threshold
= MAX8925_TOPOFF_THR_10PER
,
135 .fast_charge
= MAX8925_FCHG_1000MA
,
138 static struct max8925_platform_data jasper_max8925_info
= {
139 .backlight
= &jasper_backlight_data
,
140 .power
= &jasper_power_data
,
141 .irq_base
= MMP_NR_IRQS
,
144 static struct i2c_board_info jasper_twsi1_info
[] = {
148 .platform_data
= &jasper_max8649_info
,
153 .irq
= IRQ_MMP2_PMIC
,
154 .platform_data
= &jasper_max8925_info
,
158 static struct sdhci_pxa_platdata mmp2_sdh_platdata_mmc0
= {
159 .clk_delay_cycles
= 0x1f,
162 static void __init
jasper_init(void)
164 mfp_config(ARRAY_AND_SIZE(jasper_pin_config
));
166 /* on-chip devices */
169 mmp2_add_twsi(1, NULL
, ARRAY_AND_SIZE(jasper_twsi1_info
));
170 platform_device_add_data(&mmp2_device_gpio
, &mmp2_gpio_pdata
,
171 sizeof(struct pxa_gpio_platform_data
));
172 platform_device_register(&mmp2_device_gpio
);
173 mmp2_add_sdhost(0, &mmp2_sdh_platdata_mmc0
); /* SD/MMC */
175 regulator_has_full_constraints();
178 MACHINE_START(MARVELL_JASPER
, "Jasper Development Platform")
179 .map_io
= mmp_map_io
,
180 .nr_irqs
= JASPER_NR_IRQS
,
181 .init_irq
= mmp2_init_irq
,
182 .init_time
= mmp2_timer_init
,
183 .init_machine
= jasper_init
,
184 .restart
= mmp_restart
,