Linux Audio

Check our new training course

Loading...
v3.15
 
  1/*
  2 * Hardware definitions for Palm Zire72
  3 *
  4 * Authors:
  5 *	Vladimir "Farcaller" Pouzanov <farcaller@gmail.com>
  6 *	Sergey Lapin <slapin@ossfans.org>
  7 *	Alex Osborne <bobofdoom@gmail.com>
  8 *	Jan Herman <2hp@seznam.cz>
  9 *
 10 * Rewrite for mainline:
 11 *	Marek Vasut <marek.vasut@gmail.com>
 12 *
 13 * This program is free software; you can redistribute it and/or modify
 14 * it under the terms of the GNU General Public License version 2 as
 15 * published by the Free Software Foundation.
 16 *
 17 * (find more info at www.hackndev.com)
 18 *
 19 */
 20
 21#include <linux/platform_device.h>
 22#include <linux/syscore_ops.h>
 23#include <linux/delay.h>
 24#include <linux/irq.h>
 25#include <linux/gpio_keys.h>
 26#include <linux/input.h>
 27#include <linux/pda_power.h>
 28#include <linux/pwm_backlight.h>
 29#include <linux/gpio.h>
 30#include <linux/wm97xx.h>
 31#include <linux/power_supply.h>
 32#include <linux/usb/gpio_vbus.h>
 33#include <linux/i2c-gpio.h>
 34
 35#include <asm/mach-types.h>
 36#include <asm/suspend.h>
 37#include <asm/mach/arch.h>
 38#include <asm/mach/map.h>
 39
 40#include <mach/pxa27x.h>
 41#include <mach/audio.h>
 42#include <mach/palmz72.h>
 43#include <linux/platform_data/mmc-pxamci.h>
 44#include <linux/platform_data/video-pxafb.h>
 45#include <linux/platform_data/irda-pxaficp.h>
 46#include <linux/platform_data/keypad-pxa27x.h>
 47#include <mach/udc.h>
 48#include <linux/platform_data/asoc-palm27x.h>
 49#include <mach/palm27x.h>
 50
 51#include <mach/pm.h>
 52#include <linux/platform_data/camera-pxa.h>
 53
 54#include <media/soc_camera.h>
 
 55
 56#include "generic.h"
 57#include "devices.h"
 58
 59/******************************************************************************
 60 * Pin configuration
 61 ******************************************************************************/
 62static unsigned long palmz72_pin_config[] __initdata = {
 63	/* MMC */
 64	GPIO32_MMC_CLK,
 65	GPIO92_MMC_DAT_0,
 66	GPIO109_MMC_DAT_1,
 67	GPIO110_MMC_DAT_2,
 68	GPIO111_MMC_DAT_3,
 69	GPIO112_MMC_CMD,
 70	GPIO14_GPIO,	/* SD detect */
 71	GPIO115_GPIO,	/* SD RO */
 72	GPIO98_GPIO,	/* SD power */
 73
 74	/* AC97 */
 75	GPIO28_AC97_BITCLK,
 76	GPIO29_AC97_SDATA_IN_0,
 77	GPIO30_AC97_SDATA_OUT,
 78	GPIO31_AC97_SYNC,
 79	GPIO89_AC97_SYSCLK,
 80	GPIO113_AC97_nRESET,
 81
 82	/* IrDA */
 83	GPIO49_GPIO,	/* ir disable */
 84	GPIO46_FICP_RXD,
 85	GPIO47_FICP_TXD,
 86
 87	/* PWM */
 88	GPIO16_PWM0_OUT,
 89
 90	/* USB */
 91	GPIO15_GPIO,	/* usb detect */
 92	GPIO95_GPIO,	/* usb pullup */
 93
 94	/* Matrix keypad */
 95	GPIO100_KP_MKIN_0	| WAKEUP_ON_LEVEL_HIGH,
 96	GPIO101_KP_MKIN_1	| WAKEUP_ON_LEVEL_HIGH,
 97	GPIO102_KP_MKIN_2	| WAKEUP_ON_LEVEL_HIGH,
 98	GPIO97_KP_MKIN_3	| WAKEUP_ON_LEVEL_HIGH,
 99	GPIO103_KP_MKOUT_0,
100	GPIO104_KP_MKOUT_1,
101	GPIO105_KP_MKOUT_2,
102
103	/* LCD */
104	GPIOxx_LCD_TFT_16BPP,
105
106	GPIO20_GPIO,	/* bl power */
107	GPIO21_GPIO,	/* LCD border switch */
108	GPIO22_GPIO,	/* LCD border color */
109	GPIO96_GPIO,	/* lcd power */
110
111	/* PXA Camera */
112	GPIO81_CIF_DD_0,
113	GPIO48_CIF_DD_5,
114	GPIO50_CIF_DD_3,
115	GPIO51_CIF_DD_2,
116	GPIO52_CIF_DD_4,
117	GPIO53_CIF_MCLK,
118	GPIO54_CIF_PCLK,
119	GPIO55_CIF_DD_1,
120	GPIO84_CIF_FV,
121	GPIO85_CIF_LV,
122	GPIO93_CIF_DD_6,
123	GPIO108_CIF_DD_7,
124
125	GPIO56_GPIO,	/* OV9640 Powerdown */
126	GPIO57_GPIO,	/* OV9640 Reset */
127	GPIO91_GPIO,	/* OV9640 Power */
128
129	/* I2C */
130	GPIO117_GPIO,	/* I2C_SCL */
131	GPIO118_GPIO,	/* I2C_SDA */
132
133	/* Misc. */
134	GPIO0_GPIO	| WAKEUP_ON_LEVEL_HIGH,	/* power detect */
135	GPIO88_GPIO,				/* green led */
136	GPIO27_GPIO,				/* WM9712 IRQ */
137};
138
139/******************************************************************************
140 * GPIO keyboard
141 ******************************************************************************/
142#if defined(CONFIG_KEYBOARD_PXA27x) || defined(CONFIG_KEYBOARD_PXA27x_MODULE)
143static const unsigned int palmz72_matrix_keys[] = {
144	KEY(0, 0, KEY_POWER),
145	KEY(0, 1, KEY_F1),
146	KEY(0, 2, KEY_ENTER),
147
148	KEY(1, 0, KEY_F2),
149	KEY(1, 1, KEY_F3),
150	KEY(1, 2, KEY_F4),
151
152	KEY(2, 0, KEY_UP),
153	KEY(2, 2, KEY_DOWN),
154
155	KEY(3, 0, KEY_RIGHT),
156	KEY(3, 2, KEY_LEFT),
157};
158
159static struct matrix_keymap_data almz72_matrix_keymap_data = {
160	.keymap			= palmz72_matrix_keys,
161	.keymap_size		= ARRAY_SIZE(palmz72_matrix_keys),
162};
163
164static struct pxa27x_keypad_platform_data palmz72_keypad_platform_data = {
165	.matrix_key_rows	= 4,
166	.matrix_key_cols	= 3,
167	.matrix_keymap_data	= &almz72_matrix_keymap_data,
168
169	.debounce_interval	= 30,
170};
171
172static void __init palmz72_kpc_init(void)
173{
174	pxa_set_keypad_info(&palmz72_keypad_platform_data);
175}
176#else
177static inline void palmz72_kpc_init(void) {}
178#endif
179
180/******************************************************************************
181 * LEDs
182 ******************************************************************************/
183#if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE)
184static struct gpio_led gpio_leds[] = {
185	{
186		.name			= "palmz72:green:led",
187		.default_trigger	= "none",
188		.gpio			= GPIO_NR_PALMZ72_LED_GREEN,
189	},
190};
191
192static struct gpio_led_platform_data gpio_led_info = {
193	.leds		= gpio_leds,
194	.num_leds	= ARRAY_SIZE(gpio_leds),
195};
196
197static struct platform_device palmz72_leds = {
198	.name	= "leds-gpio",
199	.id	= -1,
200	.dev	= {
201		.platform_data	= &gpio_led_info,
202	}
203};
204
205static void __init palmz72_leds_init(void)
206{
207	platform_device_register(&palmz72_leds);
208}
209#else
210static inline void palmz72_leds_init(void) {}
211#endif
212
213#ifdef CONFIG_PM
214
215/* We have some black magic here
216 * PalmOS ROM on recover expects special struct physical address
217 * to be transferred via PSPR. Using this struct PalmOS restores
218 * its state after sleep. As for Linux, we need to setup it the
219 * same way. More than that, PalmOS ROM changes some values in memory.
220 * For now only one location is found, which needs special treatment.
221 * Thanks to Alex Osborne, Andrzej Zaborowski, and lots of other people
222 * for reading backtraces for me :)
223 */
224
225#define PALMZ72_SAVE_DWORD ((unsigned long *)0xc0000050)
226
227static struct palmz72_resume_info palmz72_resume_info = {
228	.magic0 = 0xb4e6,
229	.magic1 = 1,
230
231	/* reset state, MMU off etc */
232	.arm_control = 0,
233	.aux_control = 0,
234	.ttb = 0,
235	.domain_access = 0,
236	.process_id = 0,
237};
238
239static unsigned long store_ptr;
240
241/* syscore_ops for Palm Zire 72 PM */
242
243static int palmz72_pm_suspend(void)
244{
245	/* setup the resume_info struct for the original bootloader */
246	palmz72_resume_info.resume_addr = (u32) cpu_resume;
247
248	/* Storing memory touched by ROM */
249	store_ptr = *PALMZ72_SAVE_DWORD;
250
251	/* Setting PSPR to a proper value */
252	PSPR = virt_to_phys(&palmz72_resume_info);
253
254	return 0;
255}
256
257static void palmz72_pm_resume(void)
258{
259	*PALMZ72_SAVE_DWORD = store_ptr;
260}
261
262static struct syscore_ops palmz72_pm_syscore_ops = {
263	.suspend = palmz72_pm_suspend,
264	.resume = palmz72_pm_resume,
265};
266
267static int __init palmz72_pm_init(void)
268{
269	if (machine_is_palmz72()) {
270		register_syscore_ops(&palmz72_pm_syscore_ops);
271		return 0;
272	}
273	return -ENODEV;
274}
275
276device_initcall(palmz72_pm_init);
277#endif
278
279/******************************************************************************
280 * SoC Camera
281 ******************************************************************************/
282#if defined(CONFIG_SOC_CAMERA_OV9640) || \
283	defined(CONFIG_SOC_CAMERA_OV9640_MODULE)
284static struct pxacamera_platform_data palmz72_pxacamera_platform_data = {
285	.flags		= PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 |
286			PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN,
287	.mclk_10khz	= 2600,
288};
289
290/* Board I2C devices. */
291static struct i2c_board_info palmz72_i2c_device[] = {
292	{
293		I2C_BOARD_INFO("ov9640", 0x30),
294	}
295};
296
297static int palmz72_camera_power(struct device *dev, int power)
298{
299	gpio_set_value(GPIO_NR_PALMZ72_CAM_PWDN, !power);
300	mdelay(50);
301	return 0;
302}
303
304static int palmz72_camera_reset(struct device *dev)
305{
306	gpio_set_value(GPIO_NR_PALMZ72_CAM_RESET, 1);
307	mdelay(50);
308	gpio_set_value(GPIO_NR_PALMZ72_CAM_RESET, 0);
309	mdelay(50);
310	return 0;
311}
312
313static struct soc_camera_link palmz72_iclink = {
314	.bus_id		= 0, /* Match id in pxa27x_device_camera in device.c */
315	.board_info	= &palmz72_i2c_device[0],
316	.i2c_adapter_id	= 0,
317	.module_name	= "ov96xx",
318	.power		= &palmz72_camera_power,
319	.reset		= &palmz72_camera_reset,
320	.flags		= SOCAM_DATAWIDTH_8,
321};
322
323static struct i2c_gpio_platform_data palmz72_i2c_bus_data = {
324	.sda_pin	= 118,
325	.scl_pin	= 117,
326	.udelay		= 10,
327	.timeout	= 100,
328};
329
330static struct platform_device palmz72_i2c_bus_device = {
331	.name		= "i2c-gpio",
332	.id		= 0, /* we use this as a replacement for i2c-pxa */
333	.dev		= {
334		.platform_data	= &palmz72_i2c_bus_data,
335	}
336};
337
338static struct platform_device palmz72_camera = {
339	.name	= "soc-camera-pdrv",
340	.id	= -1,
341	.dev	= {
342		.platform_data	= &palmz72_iclink,
343	},
344};
345
346/* Here we request the camera GPIOs and configure them. We power up the camera
347 * module, deassert the reset pin, but put it into powerdown (low to no power
348 * consumption) mode. This allows us to later bring the module up fast. */
349static struct gpio palmz72_camera_gpios[] = {
350	{ GPIO_NR_PALMZ72_CAM_POWER,	GPIOF_INIT_HIGH,"Camera DVDD" },
351	{ GPIO_NR_PALMZ72_CAM_RESET,	GPIOF_INIT_LOW,	"Camera RESET" },
352	{ GPIO_NR_PALMZ72_CAM_PWDN,	GPIOF_INIT_LOW,	"Camera PWDN" },
353};
354
355static inline void __init palmz72_cam_gpio_init(void)
356{
357	int ret;
358
359	ret = gpio_request_array(ARRAY_AND_SIZE(palmz72_camera_gpios));
360	if (!ret)
361		gpio_free_array(ARRAY_AND_SIZE(palmz72_camera_gpios));
362	else
363		printk(KERN_ERR "Camera GPIO init failed!\n");
364
365	return;
366}
367
368static void __init palmz72_camera_init(void)
369{
370	palmz72_cam_gpio_init();
371	pxa_set_camera_info(&palmz72_pxacamera_platform_data);
372	platform_device_register(&palmz72_i2c_bus_device);
373	platform_device_register(&palmz72_camera);
374}
375#else
376static inline void palmz72_camera_init(void) {}
377#endif
378
379/******************************************************************************
380 * Machine init
381 ******************************************************************************/
382static void __init palmz72_init(void)
383{
384	pxa2xx_mfp_config(ARRAY_AND_SIZE(palmz72_pin_config));
385	pxa_set_ffuart_info(NULL);
386	pxa_set_btuart_info(NULL);
387	pxa_set_stuart_info(NULL);
388
389	palm27x_mmc_init(GPIO_NR_PALMZ72_SD_DETECT_N, GPIO_NR_PALMZ72_SD_RO,
390			GPIO_NR_PALMZ72_SD_POWER_N, 1);
391	palm27x_lcd_init(-1, &palm_320x320_lcd_mode);
392	palm27x_udc_init(GPIO_NR_PALMZ72_USB_DETECT_N,
393			GPIO_NR_PALMZ72_USB_PULLUP, 0);
394	palm27x_irda_init(GPIO_NR_PALMZ72_IR_DISABLE);
395	palm27x_ac97_init(PALMZ72_BAT_MIN_VOLTAGE, PALMZ72_BAT_MAX_VOLTAGE,
396			-1, 113);
397	palm27x_pwm_init(-1, -1);
398	palm27x_power_init(-1, -1);
399	palm27x_pmic_init();
400	palmz72_kpc_init();
401	palmz72_leds_init();
402	palmz72_camera_init();
403}
404
405MACHINE_START(PALMZ72, "Palm Zire72")
406	.atag_offset	= 0x100,
407	.map_io		= pxa27x_map_io,
408	.nr_irqs	= PXA_NR_IRQS,
409	.init_irq	= pxa27x_init_irq,
410	.handle_irq	= pxa27x_handle_irq,
411	.init_time	= pxa_timer_init,
412	.init_machine	= palmz72_init,
413	.restart	= pxa_restart,
414MACHINE_END
v5.14.15
  1// SPDX-License-Identifier: GPL-2.0-only
  2/*
  3 * Hardware definitions for Palm Zire72
  4 *
  5 * Authors:
  6 *	Vladimir "Farcaller" Pouzanov <farcaller@gmail.com>
  7 *	Sergey Lapin <slapin@ossfans.org>
  8 *	Alex Osborne <bobofdoom@gmail.com>
  9 *	Jan Herman <2hp@seznam.cz>
 10 *
 11 * Rewrite for mainline:
 12 *	Marek Vasut <marek.vasut@gmail.com>
 13 *
 
 
 
 
 14 * (find more info at www.hackndev.com)
 
 15 */
 16
 17#include <linux/platform_device.h>
 18#include <linux/syscore_ops.h>
 19#include <linux/delay.h>
 20#include <linux/irq.h>
 21#include <linux/gpio_keys.h>
 22#include <linux/input.h>
 23#include <linux/pda_power.h>
 24#include <linux/pwm_backlight.h>
 25#include <linux/gpio.h>
 26#include <linux/wm97xx.h>
 27#include <linux/power_supply.h>
 28#include <linux/platform_data/i2c-gpio.h>
 29#include <linux/gpio/machine.h>
 30
 31#include <asm/mach-types.h>
 32#include <asm/suspend.h>
 33#include <asm/mach/arch.h>
 34#include <asm/mach/map.h>
 35
 36#include "pxa27x.h"
 37#include <mach/audio.h>
 38#include "palmz72.h"
 39#include <linux/platform_data/mmc-pxamci.h>
 40#include <linux/platform_data/video-pxafb.h>
 41#include <linux/platform_data/irda-pxaficp.h>
 42#include <linux/platform_data/keypad-pxa27x.h>
 43#include "udc.h"
 44#include <linux/platform_data/asoc-palm27x.h>
 45#include "palm27x.h"
 
 
 
 46
 47#include "pm.h"
 48#include <linux/platform_data/media/camera-pxa.h>
 49
 50#include "generic.h"
 51#include "devices.h"
 52
 53/******************************************************************************
 54 * Pin configuration
 55 ******************************************************************************/
 56static unsigned long palmz72_pin_config[] __initdata = {
 57	/* MMC */
 58	GPIO32_MMC_CLK,
 59	GPIO92_MMC_DAT_0,
 60	GPIO109_MMC_DAT_1,
 61	GPIO110_MMC_DAT_2,
 62	GPIO111_MMC_DAT_3,
 63	GPIO112_MMC_CMD,
 64	GPIO14_GPIO,	/* SD detect */
 65	GPIO115_GPIO,	/* SD RO */
 66	GPIO98_GPIO,	/* SD power */
 67
 68	/* AC97 */
 69	GPIO28_AC97_BITCLK,
 70	GPIO29_AC97_SDATA_IN_0,
 71	GPIO30_AC97_SDATA_OUT,
 72	GPIO31_AC97_SYNC,
 73	GPIO89_AC97_SYSCLK,
 74	GPIO113_AC97_nRESET,
 75
 76	/* IrDA */
 77	GPIO49_GPIO,	/* ir disable */
 78	GPIO46_FICP_RXD,
 79	GPIO47_FICP_TXD,
 80
 81	/* PWM */
 82	GPIO16_PWM0_OUT,
 83
 84	/* USB */
 85	GPIO15_GPIO,	/* usb detect */
 86	GPIO95_GPIO,	/* usb pullup */
 87
 88	/* Matrix keypad */
 89	GPIO100_KP_MKIN_0	| WAKEUP_ON_LEVEL_HIGH,
 90	GPIO101_KP_MKIN_1	| WAKEUP_ON_LEVEL_HIGH,
 91	GPIO102_KP_MKIN_2	| WAKEUP_ON_LEVEL_HIGH,
 92	GPIO97_KP_MKIN_3	| WAKEUP_ON_LEVEL_HIGH,
 93	GPIO103_KP_MKOUT_0,
 94	GPIO104_KP_MKOUT_1,
 95	GPIO105_KP_MKOUT_2,
 96
 97	/* LCD */
 98	GPIOxx_LCD_TFT_16BPP,
 99
100	GPIO20_GPIO,	/* bl power */
101	GPIO21_GPIO,	/* LCD border switch */
102	GPIO22_GPIO,	/* LCD border color */
103	GPIO96_GPIO,	/* lcd power */
104
105	/* PXA Camera */
106	GPIO81_CIF_DD_0,
107	GPIO48_CIF_DD_5,
108	GPIO50_CIF_DD_3,
109	GPIO51_CIF_DD_2,
110	GPIO52_CIF_DD_4,
111	GPIO53_CIF_MCLK,
112	GPIO54_CIF_PCLK,
113	GPIO55_CIF_DD_1,
114	GPIO84_CIF_FV,
115	GPIO85_CIF_LV,
116	GPIO93_CIF_DD_6,
117	GPIO108_CIF_DD_7,
118
119	GPIO56_GPIO,	/* OV9640 Powerdown */
120	GPIO57_GPIO,	/* OV9640 Reset */
121	GPIO91_GPIO,	/* OV9640 Power */
122
123	/* I2C */
124	GPIO117_GPIO,	/* I2C_SCL */
125	GPIO118_GPIO,	/* I2C_SDA */
126
127	/* Misc. */
128	GPIO0_GPIO	| WAKEUP_ON_LEVEL_HIGH,	/* power detect */
129	GPIO88_GPIO,				/* green led */
130	GPIO27_GPIO,				/* WM9712 IRQ */
131};
132
133/******************************************************************************
134 * GPIO keyboard
135 ******************************************************************************/
136#if defined(CONFIG_KEYBOARD_PXA27x) || defined(CONFIG_KEYBOARD_PXA27x_MODULE)
137static const unsigned int palmz72_matrix_keys[] = {
138	KEY(0, 0, KEY_POWER),
139	KEY(0, 1, KEY_F1),
140	KEY(0, 2, KEY_ENTER),
141
142	KEY(1, 0, KEY_F2),
143	KEY(1, 1, KEY_F3),
144	KEY(1, 2, KEY_F4),
145
146	KEY(2, 0, KEY_UP),
147	KEY(2, 2, KEY_DOWN),
148
149	KEY(3, 0, KEY_RIGHT),
150	KEY(3, 2, KEY_LEFT),
151};
152
153static struct matrix_keymap_data almz72_matrix_keymap_data = {
154	.keymap			= palmz72_matrix_keys,
155	.keymap_size		= ARRAY_SIZE(palmz72_matrix_keys),
156};
157
158static struct pxa27x_keypad_platform_data palmz72_keypad_platform_data = {
159	.matrix_key_rows	= 4,
160	.matrix_key_cols	= 3,
161	.matrix_keymap_data	= &almz72_matrix_keymap_data,
162
163	.debounce_interval	= 30,
164};
165
166static void __init palmz72_kpc_init(void)
167{
168	pxa_set_keypad_info(&palmz72_keypad_platform_data);
169}
170#else
171static inline void palmz72_kpc_init(void) {}
172#endif
173
174/******************************************************************************
175 * LEDs
176 ******************************************************************************/
177#if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE)
178static struct gpio_led gpio_leds[] = {
179	{
180		.name			= "palmz72:green:led",
181		.default_trigger	= "none",
182		.gpio			= GPIO_NR_PALMZ72_LED_GREEN,
183	},
184};
185
186static struct gpio_led_platform_data gpio_led_info = {
187	.leds		= gpio_leds,
188	.num_leds	= ARRAY_SIZE(gpio_leds),
189};
190
191static struct platform_device palmz72_leds = {
192	.name	= "leds-gpio",
193	.id	= -1,
194	.dev	= {
195		.platform_data	= &gpio_led_info,
196	}
197};
198
199static void __init palmz72_leds_init(void)
200{
201	platform_device_register(&palmz72_leds);
202}
203#else
204static inline void palmz72_leds_init(void) {}
205#endif
206
207#ifdef CONFIG_PM
208
209/* We have some black magic here
210 * PalmOS ROM on recover expects special struct physical address
211 * to be transferred via PSPR. Using this struct PalmOS restores
212 * its state after sleep. As for Linux, we need to setup it the
213 * same way. More than that, PalmOS ROM changes some values in memory.
214 * For now only one location is found, which needs special treatment.
215 * Thanks to Alex Osborne, Andrzej Zaborowski, and lots of other people
216 * for reading backtraces for me :)
217 */
218
219#define PALMZ72_SAVE_DWORD ((unsigned long *)0xc0000050)
220
221static struct palmz72_resume_info palmz72_resume_info = {
222	.magic0 = 0xb4e6,
223	.magic1 = 1,
224
225	/* reset state, MMU off etc */
226	.arm_control = 0,
227	.aux_control = 0,
228	.ttb = 0,
229	.domain_access = 0,
230	.process_id = 0,
231};
232
233static unsigned long store_ptr;
234
235/* syscore_ops for Palm Zire 72 PM */
236
237static int palmz72_pm_suspend(void)
238{
239	/* setup the resume_info struct for the original bootloader */
240	palmz72_resume_info.resume_addr = (u32) cpu_resume;
241
242	/* Storing memory touched by ROM */
243	store_ptr = *PALMZ72_SAVE_DWORD;
244
245	/* Setting PSPR to a proper value */
246	PSPR = __pa_symbol(&palmz72_resume_info);
247
248	return 0;
249}
250
251static void palmz72_pm_resume(void)
252{
253	*PALMZ72_SAVE_DWORD = store_ptr;
254}
255
256static struct syscore_ops palmz72_pm_syscore_ops = {
257	.suspend = palmz72_pm_suspend,
258	.resume = palmz72_pm_resume,
259};
260
261static int __init palmz72_pm_init(void)
262{
263	if (machine_is_palmz72()) {
264		register_syscore_ops(&palmz72_pm_syscore_ops);
265		return 0;
266	}
267	return -ENODEV;
268}
269
270device_initcall(palmz72_pm_init);
271#endif
272
273static struct gpiod_lookup_table palmz72_mci_gpio_table = {
274	.dev_id = "pxa2xx-mci.0",
275	.table = {
276		GPIO_LOOKUP("gpio-pxa", GPIO_NR_PALMZ72_SD_DETECT_N,
277			    "cd", GPIO_ACTIVE_LOW),
278		GPIO_LOOKUP("gpio-pxa", GPIO_NR_PALMZ72_SD_RO,
279			    "wp", GPIO_ACTIVE_LOW),
280		GPIO_LOOKUP("gpio-pxa", GPIO_NR_PALMZ72_SD_POWER_N,
281			    "power", GPIO_ACTIVE_LOW),
282		{ },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
283	},
284};
285
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
286/******************************************************************************
287 * Machine init
288 ******************************************************************************/
289static void __init palmz72_init(void)
290{
291	pxa2xx_mfp_config(ARRAY_AND_SIZE(palmz72_pin_config));
292	pxa_set_ffuart_info(NULL);
293	pxa_set_btuart_info(NULL);
294	pxa_set_stuart_info(NULL);
295
296	palm27x_mmc_init(&palmz72_mci_gpio_table);
 
297	palm27x_lcd_init(-1, &palm_320x320_lcd_mode);
298	palm27x_udc_init(GPIO_NR_PALMZ72_USB_DETECT_N,
299			GPIO_NR_PALMZ72_USB_PULLUP, 0);
300	palm27x_irda_init(GPIO_NR_PALMZ72_IR_DISABLE);
301	palm27x_ac97_init(PALMZ72_BAT_MIN_VOLTAGE, PALMZ72_BAT_MAX_VOLTAGE,
302			-1, 113);
303	palm27x_pwm_init(-1, -1);
304	palm27x_power_init(-1, -1);
305	palm27x_pmic_init();
306	palmz72_kpc_init();
307	palmz72_leds_init();
 
308}
309
310MACHINE_START(PALMZ72, "Palm Zire72")
311	.atag_offset	= 0x100,
312	.map_io		= pxa27x_map_io,
313	.nr_irqs	= PXA_NR_IRQS,
314	.init_irq	= pxa27x_init_irq,
315	.handle_irq	= pxa27x_handle_irq,
316	.init_time	= pxa_timer_init,
317	.init_machine	= palmz72_init,
318	.restart	= pxa_restart,
319MACHINE_END