Lines Matching full:gp

158 #define do_gpio_write(gp, val) \  argument
159 pmac_call_feature(PMAC_FTR_WRITE_GPIO, NULL, (gp)->addr, val)
160 #define do_gpio_read(gp) \ argument
161 pmac_call_feature(PMAC_FTR_READ_GPIO, NULL, (gp)->addr, 0)
162 #define tumbler_gpio_free(gp) /* NOP */ argument
164 static void write_audio_gpio(struct pmac_gpio *gp, int active) in write_audio_gpio() argument
166 if (! gp->addr) in write_audio_gpio()
168 active = active ? gp->active_val : gp->inactive_val; in write_audio_gpio()
169 do_gpio_write(gp, active); in write_audio_gpio()
170 DBG("(I) gpio %x write %d\n", gp->addr, active); in write_audio_gpio()
173 static int check_audio_gpio(struct pmac_gpio *gp) in check_audio_gpio() argument
177 if (! gp->addr) in check_audio_gpio()
180 ret = do_gpio_read(gp); in check_audio_gpio()
182 return (ret & 0x1) == (gp->active_val & 0x1); in check_audio_gpio()
185 static int read_audio_gpio(struct pmac_gpio *gp) in read_audio_gpio() argument
188 if (! gp->addr) in read_audio_gpio()
190 ret = do_gpio_read(gp); in read_audio_gpio()
192 return ret == gp->active_state; in read_audio_gpio()
727 struct pmac_gpio *gp; in tumbler_get_mute_switch() local
733 gp = &mix->hp_mute; break; in tumbler_get_mute_switch()
735 gp = &mix->amp_mute; break; in tumbler_get_mute_switch()
737 gp = &mix->line_mute; break; in tumbler_get_mute_switch()
739 gp = NULL; in tumbler_get_mute_switch()
741 if (gp == NULL) in tumbler_get_mute_switch()
743 ucontrol->value.integer.value[0] = !check_audio_gpio(gp); in tumbler_get_mute_switch()
752 struct pmac_gpio *gp; in tumbler_put_mute_switch() local
763 gp = &mix->hp_mute; break; in tumbler_put_mute_switch()
765 gp = &mix->amp_mute; break; in tumbler_put_mute_switch()
767 gp = &mix->line_mute; break; in tumbler_put_mute_switch()
769 gp = NULL; in tumbler_put_mute_switch()
771 if (gp == NULL) in tumbler_put_mute_switch()
773 val = ! check_audio_gpio(gp); in tumbler_put_mute_switch()
775 write_audio_gpio(gp, ! ucontrol->value.integer.value[0]); in tumbler_put_mute_switch()
954 static void check_mute(struct snd_pmac *chip, struct pmac_gpio *gp, int val, int do_notify, in check_mute() argument
957 if (check_audio_gpio(gp) != val) { in check_mute()
958 write_audio_gpio(gp, val); in check_mute()
1093 struct pmac_gpio *gp, int is_compatible) in tumbler_find_device() argument
1123 gp->addr = addr & 0x0000ffff; in tumbler_find_device()
1127 gp->active_state = *base; in tumbler_find_device()
1128 gp->active_val = (*base) ? 0x5 : 0x4; in tumbler_find_device()
1129 gp->inactive_val = (*base) ? 0x4 : 0x5; in tumbler_find_device()
1132 gp->active_state = IS_G4DA in tumbler_find_device()
1134 gp->active_val = 0x4; in tumbler_find_device()
1135 gp->inactive_val = 0x5; in tumbler_find_device()
1144 gp->active_val = 0xd; in tumbler_find_device()
1145 gp->inactive_val = 0xc; in tumbler_find_device()
1148 gp->active_val = 0x5; in tumbler_find_device()
1149 gp->inactive_val = 0x4; in tumbler_find_device()
1155 device, gp->addr, gp->active_state); in tumbler_find_device()