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_platform_data {
38 unsigned int slave_addr;
39 unsigned long scl_rate;
40 #define I2C_MODE_IRQ 0
41 #define I2C_MODE_POLL 1
43 void (*cfg_gpio)(struct platform_device *dev);
46 struct rk2818_fb_gpio{
52 struct rk2818_fb_iomux{
61 struct rk2818_fb_mach_info {
62 struct rk2818_fb_gpio *gpio;
63 struct rk2818_fb_iomux *iomux;
71 struct timer_list timer;
72 struct notifier_block freq_transition;
75 struct rk2818_gpio_expander_info {
76 unsigned int gpio_num;// ³õʼ»¯µÄpin ½Åºê¶¨Òå È磺RK2818_PIN_PI0
77 unsigned int pin_type;//³õʼ»¯µÄpin ΪÊäÈëpin»¹ÊÇÊä³öpin È磺GPIO_IN
78 unsigned int pin_value;//Èç¹ûΪ output pin ÉèÖõçƽ£¬È磺GPIO_HIGH
82 struct pca9554_platform_data {
83 /* the first extern gpio number in all of gpio groups */
85 unsigned gpio_pin_num;
86 /* the first gpio irq number in all of irq source */
88 unsigned gpio_irq_start;
89 unsigned irq_pin_num; //ÖжϵĸöÊý
90 unsigned pca9954_irq_pin; //À©Õ¹IOµÄÖжϹÒÔÚÄĸögpio
91 /* initial polarity inversion setting */
93 struct rk2818_gpio_expander_info *settinginfo;
95 void *context; /* param to setup/teardown */
97 int (*setup)(struct i2c_client *client,unsigned gpio, unsigned ngpio,void *context);
98 int (*teardown)(struct i2c_client *client,unsigned gpio, unsigned ngpio,void *context);
101 /* common init routines for use by arch/arm/mach-msm/board-*.c */
102 void __init rk2818_add_devices(void);
103 void __init rk2818_map_common_io(void);
104 void __init rk2818_init_irq(void);
105 void __init rk2818_init_gpio(void);
106 void __init rk2818_clock_init(void);