diff options
author | Pavel Hofman <pavel.hofman@ivitera.com> | 2009-09-16 16:25:38 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2009-09-21 09:46:19 -0400 |
commit | 494703062b6e6ef5e72364aafc9bcbc172d53dea (patch) | |
tree | 146331d091b4dba7928244cd1a1ed3dbf0fbad9d /sound/pci/ice1712/ice1724.c | |
parent | 42cfa276aebd28e5cc4350ff6c7d75f1cb84dd98 (diff) |
ALSA: ice1724 - adding GPIO routines for mask and direction
* get/set routines for GPIO mask and direction
Signed-off-by: Pavel Hofman <pavel.hofman@ivitera.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/ice1712/ice1724.c')
-rw-r--r-- | sound/pci/ice1712/ice1724.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/sound/pci/ice1712/ice1724.c b/sound/pci/ice1712/ice1724.c index af6e00148621..2213beec009a 100644 --- a/sound/pci/ice1712/ice1724.c +++ b/sound/pci/ice1712/ice1724.c | |||
@@ -196,6 +196,12 @@ static void snd_vt1724_set_gpio_dir(struct snd_ice1712 *ice, unsigned int data) | |||
196 | inw(ICEREG1724(ice, GPIO_DIRECTION)); /* dummy read for pci-posting */ | 196 | inw(ICEREG1724(ice, GPIO_DIRECTION)); /* dummy read for pci-posting */ |
197 | } | 197 | } |
198 | 198 | ||
199 | /* get gpio direction 0 = read, 1 = write */ | ||
200 | static unsigned int snd_vt1724_get_gpio_dir(struct snd_ice1712 *ice) | ||
201 | { | ||
202 | return inl(ICEREG1724(ice, GPIO_DIRECTION)); | ||
203 | } | ||
204 | |||
199 | /* set the gpio mask (0 = writable) */ | 205 | /* set the gpio mask (0 = writable) */ |
200 | static void snd_vt1724_set_gpio_mask(struct snd_ice1712 *ice, unsigned int data) | 206 | static void snd_vt1724_set_gpio_mask(struct snd_ice1712 *ice, unsigned int data) |
201 | { | 207 | { |
@@ -205,6 +211,17 @@ static void snd_vt1724_set_gpio_mask(struct snd_ice1712 *ice, unsigned int data) | |||
205 | inw(ICEREG1724(ice, GPIO_WRITE_MASK)); /* dummy read for pci-posting */ | 211 | inw(ICEREG1724(ice, GPIO_WRITE_MASK)); /* dummy read for pci-posting */ |
206 | } | 212 | } |
207 | 213 | ||
214 | static unsigned int snd_vt1724_get_gpio_mask(struct snd_ice1712 *ice) | ||
215 | { | ||
216 | unsigned int mask; | ||
217 | if (!ice->vt1720) | ||
218 | mask = (unsigned int)inb(ICEREG1724(ice, GPIO_WRITE_MASK_22)); | ||
219 | else | ||
220 | mask = 0; | ||
221 | mask = (mask << 16) | inw(ICEREG1724(ice, GPIO_WRITE_MASK)); | ||
222 | return mask; | ||
223 | } | ||
224 | |||
208 | static void snd_vt1724_set_gpio_data(struct snd_ice1712 *ice, unsigned int data) | 225 | static void snd_vt1724_set_gpio_data(struct snd_ice1712 *ice, unsigned int data) |
209 | { | 226 | { |
210 | outw(data, ICEREG1724(ice, GPIO_DATA)); | 227 | outw(data, ICEREG1724(ice, GPIO_DATA)); |
@@ -2434,7 +2451,9 @@ static int __devinit snd_vt1724_create(struct snd_card *card, | |||
2434 | mutex_init(&ice->open_mutex); | 2451 | mutex_init(&ice->open_mutex); |
2435 | mutex_init(&ice->i2c_mutex); | 2452 | mutex_init(&ice->i2c_mutex); |
2436 | ice->gpio.set_mask = snd_vt1724_set_gpio_mask; | 2453 | ice->gpio.set_mask = snd_vt1724_set_gpio_mask; |
2454 | ice->gpio.get_mask = snd_vt1724_get_gpio_mask; | ||
2437 | ice->gpio.set_dir = snd_vt1724_set_gpio_dir; | 2455 | ice->gpio.set_dir = snd_vt1724_set_gpio_dir; |
2456 | ice->gpio.get_dir = snd_vt1724_get_gpio_dir; | ||
2438 | ice->gpio.set_data = snd_vt1724_set_gpio_data; | 2457 | ice->gpio.set_data = snd_vt1724_set_gpio_data; |
2439 | ice->gpio.get_data = snd_vt1724_get_gpio_data; | 2458 | ice->gpio.get_data = snd_vt1724_get_gpio_data; |
2440 | ice->card = card; | 2459 | ice->card = card; |