add gpio expander pca9554 driver
author谢修鑫 <xxx@rock-chips.com>
Tue, 25 May 2010 14:24:18 +0000 (14:24 +0000)
committer黄涛 <huangtao@rock-chips.com>
Mon, 21 Jun 2010 05:35:16 +0000 (13:35 +0800)
arch/arm/mach-rk2818/include/mach/board.h

index d98c1f56825a26c7591b4802230535c898008b1a..0f0f666246b691446af880c5d1de1e7261683b55 100644 (file)
@@ -74,6 +74,32 @@ struct rk2818bl_info{
     struct notifier_block freq_transition;
 };
 
+struct rk2818_gpio_expander_info {
+       unsigned int gpio_num;// ³õʼ»¯µÄpin ½Åºê¶¨Òå È磺RK2818_PIN_PI0
+       unsigned int pin_type;//³õʼ»¯µÄpin ÎªÊäÈëpin»¹ÊÇÊä³öpin È磺GPIO_IN
+       unsigned int pin_value;//Èç¹ûΪ output pin ÉèÖÃµçÆ½£¬È磺GPIO_HIGH
+};
+
+
+struct pca9554_platform_data {
+       /*  the first extern gpio number in all of gpio groups */
+       unsigned gpio_base;
+       unsigned        gpio_pin_num;
+       /*  the first gpio irq  number in all of irq source */
+
+       unsigned gpio_irq_start;
+       unsigned irq_pin_num;        //ÖжϵĸöÊý
+       unsigned    pca9954_irq_pin;        //À©Õ¹IOµÄÖжϹÒÔÚÄĸögpio
+       /* initial polarity inversion setting */
+       uint16_t        invert;
+       struct rk2818_gpio_expander_info  *settinginfo;
+       int  settinginfolen;
+       void            *context;       /* param to setup/teardown */
+
+       int             (*setup)(struct i2c_client *client,unsigned gpio, unsigned ngpio,void *context);
+       int             (*teardown)(struct i2c_client *client,unsigned gpio, unsigned ngpio,void *context);
+       char            **names;
+};
 /* common init routines for use by arch/arm/mach-msm/board-*.c */
 void __init rk2818_add_devices(void);
 void __init rk2818_map_common_io(void);