Haojian Zhuang | c9b5ef4 | 2010-11-24 11:54:20 +0800 | [diff] [blame] | 1 | /* |
| 2 | * linux/arch/arm/mach-pxa/saarb.c |
| 3 | * |
| 4 | * Support for the Marvell Handheld Platform (aka SAARB) |
| 5 | * |
| 6 | * Copyright (C) 2007-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 | */ |
Russell King | 2f8163b | 2011-07-26 10:53:52 +0100 | [diff] [blame] | 12 | #include <linux/gpio.h> |
Haojian Zhuang | c9b5ef4 | 2010-11-24 11:54:20 +0800 | [diff] [blame] | 13 | #include <linux/init.h> |
| 14 | #include <linux/kernel.h> |
| 15 | #include <linux/i2c.h> |
Sebastian Andrzej Siewior | b459396 | 2011-02-23 12:38:16 +0100 | [diff] [blame] | 16 | #include <linux/i2c/pxa-i2c.h> |
Haojian Zhuang | c9b5ef4 | 2010-11-24 11:54:20 +0800 | [diff] [blame] | 17 | #include <linux/mfd/88pm860x.h> |
| 18 | |
| 19 | #include <asm/mach-types.h> |
| 20 | #include <asm/mach/arch.h> |
| 21 | |
| 22 | #include <mach/irqs.h> |
| 23 | #include <mach/hardware.h> |
| 24 | #include <mach/mfp.h> |
| 25 | #include <mach/mfp-pxa930.h> |
Eric Miao | 654a60e | 2011-10-07 15:28:29 +0800 | [diff] [blame] | 26 | #include <mach/pxa95x.h> |
Haojian Zhuang | c9b5ef4 | 2010-11-24 11:54:20 +0800 | [diff] [blame] | 27 | |
Haojian Zhuang | c9b5ef4 | 2010-11-24 11:54:20 +0800 | [diff] [blame] | 28 | #include "generic.h" |
| 29 | |
| 30 | #define SAARB_NR_IRQS (IRQ_BOARD_START + 40) |
| 31 | |
| 32 | static struct pm860x_touch_pdata saarb_touch = { |
| 33 | .gpadc_prebias = 1, |
| 34 | .slot_cycle = 1, |
| 35 | .tsi_prebias = 6, |
| 36 | .pen_prebias = 16, |
| 37 | .pen_prechg = 2, |
| 38 | .res_x = 300, |
| 39 | }; |
| 40 | |
| 41 | static struct pm860x_backlight_pdata saarb_backlight[] = { |
| 42 | { |
| 43 | .id = PM8606_ID_BACKLIGHT, |
| 44 | .iset = PM8606_WLED_CURRENT(24), |
| 45 | .flags = PM8606_BACKLIGHT1, |
| 46 | }, |
| 47 | {}, |
| 48 | }; |
| 49 | |
| 50 | static struct pm860x_led_pdata saarb_led[] = { |
| 51 | { |
| 52 | .id = PM8606_ID_LED, |
| 53 | .iset = PM8606_LED_CURRENT(12), |
| 54 | .flags = PM8606_LED1_RED, |
| 55 | }, { |
| 56 | .id = PM8606_ID_LED, |
| 57 | .iset = PM8606_LED_CURRENT(12), |
| 58 | .flags = PM8606_LED1_GREEN, |
| 59 | }, { |
| 60 | .id = PM8606_ID_LED, |
| 61 | .iset = PM8606_LED_CURRENT(12), |
| 62 | .flags = PM8606_LED1_BLUE, |
| 63 | }, { |
| 64 | .id = PM8606_ID_LED, |
| 65 | .iset = PM8606_LED_CURRENT(12), |
| 66 | .flags = PM8606_LED2_RED, |
| 67 | }, { |
| 68 | .id = PM8606_ID_LED, |
| 69 | .iset = PM8606_LED_CURRENT(12), |
| 70 | .flags = PM8606_LED2_GREEN, |
| 71 | }, { |
| 72 | .id = PM8606_ID_LED, |
| 73 | .iset = PM8606_LED_CURRENT(12), |
| 74 | .flags = PM8606_LED2_BLUE, |
| 75 | }, |
| 76 | }; |
| 77 | |
| 78 | static struct pm860x_platform_data saarb_pm8607_info = { |
| 79 | .touch = &saarb_touch, |
| 80 | .backlight = &saarb_backlight[0], |
| 81 | .led = &saarb_led[0], |
| 82 | .companion_addr = 0x10, |
| 83 | .irq_mode = 0, |
| 84 | .irq_base = IRQ_BOARD_START, |
| 85 | |
| 86 | .i2c_port = GI2C_PORT, |
| 87 | }; |
| 88 | |
| 89 | static struct i2c_board_info saarb_i2c_info[] = { |
| 90 | { |
| 91 | .type = "88PM860x", |
| 92 | .addr = 0x34, |
| 93 | .platform_data = &saarb_pm8607_info, |
Haojian Zhuang | 4929f5a | 2011-10-10 16:03:51 +0800 | [diff] [blame] | 94 | .irq = PXA_GPIO_TO_IRQ(mfp_to_gpio(MFP_PIN_GPIO83)), |
Haojian Zhuang | c9b5ef4 | 2010-11-24 11:54:20 +0800 | [diff] [blame] | 95 | }, |
| 96 | }; |
| 97 | |
| 98 | static void __init saarb_init(void) |
| 99 | { |
| 100 | pxa_set_ffuart_info(NULL); |
| 101 | pxa_set_i2c_info(NULL); |
| 102 | i2c_register_board_info(0, ARRAY_AND_SIZE(saarb_i2c_info)); |
| 103 | } |
| 104 | |
| 105 | MACHINE_START(SAARB, "PXA955 Handheld Platform (aka SAARB)") |
Nicolas Pitre | 7375aba | 2011-07-05 22:38:15 -0400 | [diff] [blame] | 106 | .atag_offset = 0x100, |
Eric Miao | 150f164 | 2011-05-18 15:48:32 +0800 | [diff] [blame] | 107 | .map_io = pxa3xx_map_io, |
Haojian Zhuang | c9b5ef4 | 2010-11-24 11:54:20 +0800 | [diff] [blame] | 108 | .nr_irqs = SAARB_NR_IRQS, |
| 109 | .init_irq = pxa95x_init_irq, |
Eric Miao | 8a97ae2 | 2011-05-18 21:30:04 +0800 | [diff] [blame] | 110 | .handle_irq = pxa3xx_handle_irq, |
Haojian Zhuang | c9b5ef4 | 2010-11-24 11:54:20 +0800 | [diff] [blame] | 111 | .timer = &pxa_timer, |
| 112 | .init_machine = saarb_init, |
Russell King | 271a74f | 2011-11-04 14:15:53 +0000 | [diff] [blame] | 113 | .restart = pxa_restart, |
Haojian Zhuang | c9b5ef4 | 2010-11-24 11:54:20 +0800 | [diff] [blame] | 114 | MACHINE_END |
| 115 | |