From: <hap...@us...> - 2007-02-03 02:09:28
|
Revision: 793 http://svn.sourceforge.net/hackndev/?rev=793&view=rev Author: happy-slapin Date: 2007-02-02 18:09:26 -0800 (Fri, 02 Feb 2007) Log Message: ----------- ALL: forgot to add include :) Modified Paths: -------------- linux4palm/linux/trunk/include/linux/wm97xx.h Modified: linux4palm/linux/trunk/include/linux/wm97xx.h =================================================================== --- linux4palm/linux/trunk/include/linux/wm97xx.h 2007-02-03 02:07:36 UTC (rev 792) +++ linux4palm/linux/trunk/include/linux/wm97xx.h 2007-02-03 02:09:26 UTC (rev 793) @@ -1,3 +1,4 @@ + /* * Register bits and API for Wolfson WM97xx series of codecs */ @@ -101,6 +102,7 @@ #define WM9713_COO 0x0001 /* enable coordinate mode */ #define WM9713_PDEN 0x0800 /* measure only when pen down */ #define WM9713_ADCSEL_MASK 0x00fe /* ADC selection mask */ +#define WM9713_WAIT 0x0200 /* coordinate wait */ /* AUX ADC ID's */ #define TS_COMP1 0x0 @@ -150,7 +152,7 @@ #define RC_PENDOWN 0x00000008 /* The wm97xx driver provides a private API for writing platform-specific - * drivers. + * drivers. */ /* The structure used to return arch specific sampled data into */ @@ -203,6 +205,7 @@ #define WM97XX_DIG_STOP 0x2 #define WM97XX_PHY_INIT 0x3 #define WM97XX_AUX_PREPARE 0x4 +#define WM97XX_DIG_RESTORE 0x5 struct wm97xx; extern struct wm97xx_codec_drv wm97xx_codec; @@ -212,6 +215,7 @@ */ struct wm97xx_codec_drv { u16 id; + char *name; int (*poll_sample) (struct wm97xx *, int adcsel, int *sample); /* read 1 sample */ int (*poll_touch) (struct wm97xx *, struct wm97xx_data *); /* read X,Y,[P] in poll */ int (*digitiser_ioctl) (struct wm97xx *, int cmd); @@ -219,12 +223,32 @@ }; +/* Machine specific and accelerated touch operations */ +struct wm97xx_mach_ops { + + /* accelerated touch readback - coords are transmited on AC97 link */ + int acc_enabled; + void (*acc_pen_up) (struct wm97xx *); + int (*acc_pen_down) (struct wm97xx *); + int (*acc_startup) (struct wm97xx *); + void (*acc_shutdown) (struct wm97xx *); + + /* pre and post sample - can be used to minimise any analog noise */ + void (*pre_sample) (int); /* function to run before sampling */ + void (*post_sample) (int); /* function to run after sampling */ +}; + struct wm97xx { - u16 dig[3], id; /* Cached codec registers */ + u16 dig[3], id, gpio[6], misc; /* Cached codec registers */ + u16 dig_save[3]; /* saved during aux reading */ struct wm97xx_codec_drv *codec; /* attached codec driver*/ struct input_dev* input_dev; /* touchscreen input device */ ac97_t *ac97; /* ALSA codec access */ struct device *dev; /* ALSA device */ + struct device *battery_dev; + struct device *touch_dev; + struct wm97xx_mach_ops *mach_ops; + struct mutex codec_mutex; struct completion ts_init; struct completion ts_exit; struct task_struct *ts_task; @@ -240,20 +264,6 @@ unsigned pen_probably_down:1; /* used in polling mode */ }; -/* - * Misc wm97xx devices for aux adc, gpio, etc - */ -struct wm97xx_misc_dev { - int (*probe)(struct wm97xx *wm); - void (*remove)(struct wm97xx *wm); - int (*suspend)(struct wm97xx *wm, pm_message_t state); - int (*resume)(struct wm97xx *wm); - struct list_head list; -}; - -int wm97xx_register_misc_dev(struct wm97xx_misc_dev* mdev); -void wm97xx_unregister_misc_dev(struct wm97xx_misc_dev* mdev); - /* Codec GPIO access (not supported on WM9705) * This can be used to set/get codec GPIO and Virtual GPIO status. */ @@ -267,16 +277,15 @@ wm97xx_gpio_wake_t wake); /* codec AC97 IO access */ -int wm97xx_reg_read(struct wm97xx *wm, u16 reg); +int wm97xx_reg_read(struct wm97xx *wm, u16 reg); void wm97xx_reg_write(struct wm97xx *wm, u16 reg, u16 val); /* aux adc readback */ int wm97xx_read_aux_adc(struct wm97xx *wm, u16 adcsel); -/* continuous touch interface */ -void wm97xx_acc_pen_up (struct wm97xx* wm); -int wm97xx_acc_pen_down (struct wm97xx* wm); -int wm97xx_acc_startup(struct wm97xx* wm); -void wm97xx_acc_shutdown(struct wm97xx* wm); +/* machine ops */ +int wm97xx_register_mach_ops(struct wm97xx *, struct wm97xx_mach_ops *); +void wm97xx_unregister_mach_ops(struct wm97xx *); +extern struct bus_type wm97xx_bus_type; #endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |