diff options
author | Robert Jarzmik <robert.jarzmik@free.fr> | 2008-11-15 10:09:54 -0500 |
---|---|---|
committer | Eric Miao <eric.miao@marvell.com> | 2008-12-02 01:43:48 -0500 |
commit | 8e7ccddf0fd22617a3edc28ab2ce2fac0fb94823 (patch) | |
tree | 21630b016bb9e1164494cf32be65168a1582e060 | |
parent | 0bcd30ec8deff327ae0becffb0fc7ee9dc90db82 (diff) |
[ARM] pxa/MioA701: add camera support for Mio A701 board.
Add GPIO configuration and platform specific declarations
to make Mitac Mio A701 camera chip work. The chip is a
Micron MT9M111 CMOS sensor, based on PXA QIF interface and
I2C bus for sensor control.
Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Eric Miao <eric.miao@marvell.com>
-rw-r--r-- | arch/arm/mach-pxa/mioa701.c | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/arch/arm/mach-pxa/mioa701.c b/arch/arm/mach-pxa/mioa701.c index 0842c531ee4d..3fe95a04b196 100644 --- a/arch/arm/mach-pxa/mioa701.c +++ b/arch/arm/mach-pxa/mioa701.c | |||
@@ -46,6 +46,9 @@ | |||
46 | #include <mach/mmc.h> | 46 | #include <mach/mmc.h> |
47 | #include <mach/udc.h> | 47 | #include <mach/udc.h> |
48 | #include <mach/pxa27x-udc.h> | 48 | #include <mach/pxa27x-udc.h> |
49 | #include <mach/i2c.h> | ||
50 | #include <mach/camera.h> | ||
51 | #include <media/soc_camera.h> | ||
49 | 52 | ||
50 | #include <mach/mioa701.h> | 53 | #include <mach/mioa701.h> |
51 | 54 | ||
@@ -98,6 +101,20 @@ static unsigned long mioa701_pin_config[] = { | |||
98 | GPIO75_LCD_LCLK, | 101 | GPIO75_LCD_LCLK, |
99 | GPIO76_LCD_PCLK, | 102 | GPIO76_LCD_PCLK, |
100 | 103 | ||
104 | /* QCI */ | ||
105 | GPIO12_CIF_DD_7, | ||
106 | GPIO17_CIF_DD_6, | ||
107 | GPIO50_CIF_DD_3, | ||
108 | GPIO51_CIF_DD_2, | ||
109 | GPIO52_CIF_DD_4, | ||
110 | GPIO53_CIF_MCLK, | ||
111 | GPIO54_CIF_PCLK, | ||
112 | GPIO55_CIF_DD_1, | ||
113 | GPIO81_CIF_DD_0, | ||
114 | GPIO82_CIF_DD_5, | ||
115 | GPIO84_CIF_FV, | ||
116 | GPIO85_CIF_LV, | ||
117 | |||
101 | /* Bluetooth */ | 118 | /* Bluetooth */ |
102 | GPIO44_BTUART_CTS, | 119 | GPIO44_BTUART_CTS, |
103 | GPIO42_BTUART_RXD, | 120 | GPIO42_BTUART_RXD, |
@@ -151,6 +168,10 @@ static unsigned long mioa701_pin_config[] = { | |||
151 | GPIO104_KP_MKOUT_1, | 168 | GPIO104_KP_MKOUT_1, |
152 | GPIO105_KP_MKOUT_2, | 169 | GPIO105_KP_MKOUT_2, |
153 | 170 | ||
171 | /* I2C */ | ||
172 | GPIO117_I2C_SCL, | ||
173 | GPIO118_I2C_SDA, | ||
174 | |||
154 | /* Unknown */ | 175 | /* Unknown */ |
155 | MFP_CFG_IN(GPIO14, AF0), | 176 | MFP_CFG_IN(GPIO14, AF0), |
156 | MFP_CFG_IN(GPIO20, AF0), | 177 | MFP_CFG_IN(GPIO20, AF0), |
@@ -807,6 +828,32 @@ static int __init mioa701_battery_init(void) | |||
807 | #endif | 828 | #endif |
808 | 829 | ||
809 | /* | 830 | /* |
831 | * Camera interface | ||
832 | */ | ||
833 | struct pxacamera_platform_data mioa701_pxacamera_platform_data = { | ||
834 | .flags = PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 | | ||
835 | PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN, | ||
836 | .mclk_10khz = 5000, | ||
837 | }; | ||
838 | |||
839 | static struct soc_camera_link iclink = { | ||
840 | .bus_id = 0, /* Must match id in pxa27x_device_camera in device.c */ | ||
841 | }; | ||
842 | |||
843 | /* Board I2C devices. */ | ||
844 | static struct i2c_board_info __initdata mioa701_i2c_devices[] = { | ||
845 | { | ||
846 | /* Must initialize before the camera(s) */ | ||
847 | I2C_BOARD_INFO("mt9m111", 0x5d), | ||
848 | .platform_data = &iclink, | ||
849 | }, | ||
850 | }; | ||
851 | |||
852 | struct i2c_pxa_platform_data i2c_pdata = { | ||
853 | .fast_mode = 1, | ||
854 | }; | ||
855 | |||
856 | /* | ||
810 | * Mio global | 857 | * Mio global |
811 | */ | 858 | */ |
812 | 859 | ||
@@ -885,6 +932,10 @@ static void __init mioa701_machine_init(void) | |||
885 | platform_add_devices(devices, ARRAY_SIZE(devices)); | 932 | platform_add_devices(devices, ARRAY_SIZE(devices)); |
886 | gsm_init(); | 933 | gsm_init(); |
887 | mioa701_battery_init(); | 934 | mioa701_battery_init(); |
935 | |||
936 | pxa_set_i2c_info(&i2c_pdata); | ||
937 | pxa_set_camera_info(&mioa701_pxacamera_platform_data); | ||
938 | i2c_register_board_info(0, ARRAY_AND_SIZE(mioa701_i2c_devices)); | ||
888 | } | 939 | } |
889 | 940 | ||
890 | static void mioa701_machine_exit(void) | 941 | static void mioa701_machine_exit(void) |