1 /* arch/arm/mach-rk2818/include/mach/board.h
3 * Copyright (C) 2010 ROCKCHIP, Inc.
5 * This software is licensed under the terms of the GNU General Public
6 * License version 2, as published by the Free Software Foundation, and
7 * may be copied, distributed, and modified under those terms.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
16 #ifndef __ASM_ARCH_RK2818_BOARD_H
17 #define __ASM_ARCH_RK2818_BOARD_H
19 #include <linux/types.h>
20 #include <linux/timer.h>
21 #include <linux/notifier.h>
23 /* platform device data structures */
24 struct platform_device;
26 struct rk2818_sdmmc_platform_data {
27 unsigned int host_caps;
28 unsigned int host_ocr_avail;
29 unsigned int use_dma:1;
30 unsigned int no_detect:1;
32 void (*cfg_gpio)(struct platform_device *dev);
35 struct rk2818_i2c_spi_data {
38 unsigned int slave_addr;
39 unsigned long scl_rate;
41 struct rk2818_i2c_platform_data {
44 unsigned int slave_addr;
45 unsigned long scl_rate;
46 #define I2C_MODE_IRQ 0
47 #define I2C_MODE_POLL 1
49 void (*cfg_gpio)(struct platform_device *dev);
52 struct rk2818_fb_gpio{
58 struct rk2818_fb_iomux{
67 struct rk2818_fb_mach_info {
68 struct rk2818_fb_gpio *gpio;
69 struct rk2818_fb_iomux *iomux;
77 struct timer_list timer;
78 struct notifier_block freq_transition;
81 struct rk2818_gpio_expander_info {
82 unsigned int gpio_num;// ³õʼ»¯µÄpin ½Åºê¶¨Òå È磺RK2818_PIN_PI0
83 unsigned int pin_type;//³õʼ»¯µÄpin ΪÊäÈëpin»¹ÊÇÊä³öpin È磺GPIO_IN
84 unsigned int pin_value;//Èç¹ûΪ output pin ÉèÖõçƽ£¬È磺GPIO_HIGH
88 struct pca9554_platform_data {
89 /* the first extern gpio number in all of gpio groups */
91 unsigned gpio_pin_num;
92 /* the first gpio irq number in all of irq source */
94 unsigned gpio_irq_start;
95 unsigned irq_pin_num; //ÖжϵĸöÊý
96 unsigned pca9954_irq_pin; //À©Õ¹IOµÄÖжϹÒÔÚÄĸögpio
97 /* initial polarity inversion setting */
99 struct rk2818_gpio_expander_info *settinginfo;
101 void *context; /* param to setup/teardown */
103 int (*setup)(struct i2c_client *client,unsigned gpio, unsigned ngpio,void *context);
104 int (*teardown)(struct i2c_client *client,unsigned gpio, unsigned ngpio,void *context);
109 struct lcd_td043mgea1_data{
113 void (*screen_set_iomux)(u8 enable);
116 //ROCKCHIP AD KEY CODE ,for demo board
118 #define AD2KEY1 114 ///VOLUME_DOWN
119 #define AD2KEY2 115 ///VOLUME_UP
120 #define AD2KEY3 59 ///MENU
121 #define AD2KEY4 102 ///HOME
122 #define AD2KEY5 158 ///BACK
123 #define AD2KEY6 61 ///CALL
124 #define AD2KEY7 127 ///SEARCH
126 #define KEYSTART 28 //ENTER
127 #define KEYMENU AD2KEY6 ///CALL
128 #define KEY_PLAY_SHORT_PRESS KEYSTART //code for short press the play key
129 #define KEY_PLAY_LONG_PRESS ENDCALL //code for long press the play key
132 typedef struct tagADC_keyst
134 unsigned int adc_value;
135 unsigned int adc_keycode;
136 }ADC_keyst,*pADC_keyst;
146 ADC_keyst * adc_key_table;
147 unsigned char *initKeyCode;
151 /* common init routines for use by arch/arm/mach-msm/board-*.c */
152 void __init rk2818_add_devices(void);
153 void __init rk2818_map_common_io(void);
154 void __init rk2818_init_irq(void);
155 void __init rk2818_init_gpio(void);
156 void __init rk2818_clock_init(void);