Lines Matching refs:pt

32 int snd_pt2258_reset(struct snd_pt2258 *pt)  in snd_pt2258_reset()  argument
39 snd_i2c_lock(pt->i2c_bus); in snd_pt2258_reset()
40 if (snd_i2c_sendbytes(pt->i2c_dev, bytes, 1) != 1) in snd_pt2258_reset()
42 snd_i2c_unlock(pt->i2c_bus); in snd_pt2258_reset()
45 pt->mute = 1; in snd_pt2258_reset()
47 snd_i2c_lock(pt->i2c_bus); in snd_pt2258_reset()
48 if (snd_i2c_sendbytes(pt->i2c_dev, bytes, 1) != 1) in snd_pt2258_reset()
50 snd_i2c_unlock(pt->i2c_bus); in snd_pt2258_reset()
54 pt->volume[i] = 0; in snd_pt2258_reset()
57 snd_i2c_lock(pt->i2c_bus); in snd_pt2258_reset()
58 if (snd_i2c_sendbytes(pt->i2c_dev, bytes, 2) != 2) in snd_pt2258_reset()
60 snd_i2c_unlock(pt->i2c_bus); in snd_pt2258_reset()
65 snd_i2c_unlock(pt->i2c_bus); in snd_pt2258_reset()
66 dev_err(pt->card->dev, "PT2258 reset failed\n"); in snd_pt2258_reset()
83 struct snd_pt2258 *pt = kcontrol->private_data; in pt2258_stereo_volume_get() local
87 ucontrol->value.integer.value[0] = 79 - pt->volume[base]; in pt2258_stereo_volume_get()
88 ucontrol->value.integer.value[1] = 79 - pt->volume[base + 1]; in pt2258_stereo_volume_get()
95 struct snd_pt2258 *pt = kcontrol->private_data; in pt2258_stereo_volume_put() local
104 if (val0 == pt->volume[base] && val1 == pt->volume[base + 1]) in pt2258_stereo_volume_put()
107 pt->volume[base] = val0; in pt2258_stereo_volume_put()
110 snd_i2c_lock(pt->i2c_bus); in pt2258_stereo_volume_put()
111 if (snd_i2c_sendbytes(pt->i2c_dev, bytes, 2) != 2) in pt2258_stereo_volume_put()
113 snd_i2c_unlock(pt->i2c_bus); in pt2258_stereo_volume_put()
115 pt->volume[base + 1] = val1; in pt2258_stereo_volume_put()
118 snd_i2c_lock(pt->i2c_bus); in pt2258_stereo_volume_put()
119 if (snd_i2c_sendbytes(pt->i2c_dev, bytes, 2) != 2) in pt2258_stereo_volume_put()
121 snd_i2c_unlock(pt->i2c_bus); in pt2258_stereo_volume_put()
126 snd_i2c_unlock(pt->i2c_bus); in pt2258_stereo_volume_put()
127 dev_err(pt->card->dev, "PT2258 access failed\n"); in pt2258_stereo_volume_put()
136 struct snd_pt2258 *pt = kcontrol->private_data; in pt2258_switch_get() local
138 ucontrol->value.integer.value[0] = !pt->mute; in pt2258_switch_get()
145 struct snd_pt2258 *pt = kcontrol->private_data; in pt2258_switch_put() local
150 if (pt->mute == val) in pt2258_switch_put()
153 pt->mute = val; in pt2258_switch_put()
155 snd_i2c_lock(pt->i2c_bus); in pt2258_switch_put()
156 if (snd_i2c_sendbytes(pt->i2c_dev, bytes, 1) != 1) in pt2258_switch_put()
158 snd_i2c_unlock(pt->i2c_bus); in pt2258_switch_put()
163 snd_i2c_unlock(pt->i2c_bus); in pt2258_switch_put()
164 dev_err(pt->card->dev, "PT2258 access failed 2\n"); in pt2258_switch_put()
170 int snd_pt2258_build_controls(struct snd_pt2258 *pt) in snd_pt2258_build_controls() argument
193 err = snd_ctl_add(pt->card, snd_ctl_new1(&knew, pt)); in snd_pt2258_build_controls()
205 err = snd_ctl_add(pt->card, snd_ctl_new1(&knew, pt)); in snd_pt2258_build_controls()