/* WM9705 Bits */ #define WM9705_PDEN 0x1000 /* measure only when pen is down */ #define WM9705_PINV 0x0800 /* inverts sense of pen down output */ #define WM9705_BSEN 0x0400 /* BUSY flag enable, pin47 is 1 when busy */ #define WM9705_BINV 0x0200 /* invert BUSY (pin47) output */ #define WM9705_WAIT 0x0100 /* wait until adc is read before next sample */ #define WM9705_PIL 0x0080 /* current used for pressure measurement. set 400uA else 200uA */ #define WM9705_PHIZ 0x0040 /* set PHONE and PCBEEP inputs to high impedance */ #define WM9705_MASK_HI 0x0010 /* hi on mask stops conversions */ #define WM9705_MASK_EDGE 0x0020 /* rising/falling edge on pin delays sample */ #define WM9705_MASK_SYNC 0x0030 /* rising/falling edge on mask initiates sample */ #define WM9705_PDD(i) (i & 0x000f) /* pen detect comparator threshold */
#define AC97_LINK_FRAME 21/* time in uS for AC97 link frame */
/*---------------- Return codes from sample reading functions ---------------*/
/* More data is available; call the sample gathering function again */ #define RC_AGAIN 0x00000001 /* The returned sample is valid */ #define RC_VALID 0x00000002 /* The pen is up (the first RC_VALID without RC_PENUP means pen is down) */ #define RC_PENUP 0x00000004 /* The pen is down (RC_VALID implies RC_PENDOWN, but sometimes it is helpful totellthehandlerthatthepenisdownbutwedon'tknowyethiscoords,
so the handler should not sleep or wait for pendown irq) */ #define RC_PENDOWN 0x00000008
/* read 1 sample */ int (*poll_sample) (struct wm97xx *, int adcsel, int *sample);
/* read X,Y,[P] in poll */ int (*poll_touch) (struct wm97xx *, struct wm97xx_data *);
int (*acc_enable) (struct wm97xx *, int enable); void (*phy_init) (struct wm97xx *); void (*dig_enable) (struct wm97xx *, int enable); void (*dig_restore) (struct wm97xx *); void (*aux_prepare) (struct wm97xx *);
};
/* 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 *);
/* GPIO pin used for accelerated operation */ int irq_gpio;
/* 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, 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 */ struct snd_ac97 *ac97; /* ALSA codec access */ struct device *dev; /* ALSA device */ struct platform_device *battery_dev; struct platform_device *touch_dev; struct wm97xx_mach_ops *mach_ops; struct mutex codec_mutex; struct delayed_work ts_reader; /* Used to poll touchscreen */ unsignedlong ts_reader_interval; /* Current interval for timer */ unsignedlong ts_reader_min_interval; /* Minimum interval */ unsignedint pen_irq; /* Pen IRQ number in use */ struct workqueue_struct *ts_workq;
u16 acc_slot; /* AC97 slot used for acc touch data */
u16 acc_rate; /* acc touch data rate */ unsigned pen_is_down:1; /* Pen is down */ unsigned aux_waiting:1; /* aux measurement waiting */ unsigned pen_probably_down:1; /* used in polling mode */
u16 variant; /* WM97xx chip variant */
u16 suspend_mode; /* PRP in suspend mode */
};
struct wm97xx_batt_pdata { int batt_aux; int temp_aux; int min_voltage; int max_voltage; int batt_div; int batt_mult; int temp_div; int temp_mult; int batt_tech; char *batt_name;
};
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.