Lines Matching refs:fmr2

31 struct fmr2 {  struct
41 static struct fmr2 *fmr2_cards[FMR2_MAX]; argument
62 struct fmr2 *fmr2 = tea->private_data; in fmr2_tea575x_set_pins() local
70 outb(bits, fmr2->io); in fmr2_tea575x_set_pins()
75 struct fmr2 *fmr2 = tea->private_data; in fmr2_tea575x_get_pins() local
76 u8 bits = inb(fmr2->io); in fmr2_tea575x_get_pins()
116 static void tc9154a_set_pins(struct fmr2 *fmr2, u8 pins) in tc9154a_set_pins() argument
118 if (!fmr2->tea.mute) in tc9154a_set_pins()
121 outb(pins, fmr2->io); in tc9154a_set_pins()
124 static void tc9154a_set_attenuation(struct fmr2 *fmr2, int att, u32 channel) in tc9154a_set_attenuation() argument
135 tc9154a_set_pins(fmr2, bit); in tc9154a_set_attenuation()
137 tc9154a_set_pins(fmr2, bit | PT_CK); in tc9154a_set_attenuation()
139 tc9154a_set_pins(fmr2, bit); in tc9154a_set_attenuation()
144 tc9154a_set_pins(fmr2, PT_ST); in tc9154a_set_attenuation()
146 tc9154a_set_pins(fmr2, 0); in tc9154a_set_attenuation()
152 struct fmr2 *fmr2 = tea->private_data; in fmr2_s_ctrl() local
158 balance = fmr2->balance->cur.val; in fmr2_s_ctrl()
162 volume = fmr2->volume->cur.val; in fmr2_s_ctrl()
174 tc9154a_set_attenuation(fmr2, abs(left - 68), TC9154A_CHANNEL_LEFT); in fmr2_s_ctrl()
175 tc9154a_set_attenuation(fmr2, abs(right - 68), TC9154A_CHANNEL_RIGHT); in fmr2_s_ctrl()
186 struct fmr2 *fmr2 = tea->private_data; in fmr2_tea_ext_init() local
189 if (!fmr2->is_fmd2 && inb(fmr2->io) & FMR2_HASVOL) { in fmr2_tea_ext_init()
190fmr2->volume = v4l2_ctrl_new_std(&tea->ctrl_handler, &fmr2_ctrl_ops, V4L2_CID_AUDIO_VOLUME, 0, 68,… in fmr2_tea_ext_init()
191fmr2->balance = v4l2_ctrl_new_std(&tea->ctrl_handler, &fmr2_ctrl_ops, V4L2_CID_AUDIO_BALANCE, -68,… in fmr2_tea_ext_init()
207 static int fmr2_probe(struct fmr2 *fmr2, struct device *pdev, int io) in fmr2_probe() argument
210 char *card_name = fmr2->is_fmd2 ? "SF16-FMD2" : "SF16-FMR2"; in fmr2_probe()
217 strscpy(fmr2->v4l2_dev.name, "radio-sf16fmr2", in fmr2_probe()
218 sizeof(fmr2->v4l2_dev.name)); in fmr2_probe()
219 fmr2->io = io; in fmr2_probe()
221 if (!request_region(fmr2->io, 2, fmr2->v4l2_dev.name)) { in fmr2_probe()
222 printk(KERN_ERR "radio-sf16fmr2: I/O port 0x%x already in use\n", fmr2->io); in fmr2_probe()
226 dev_set_drvdata(pdev, fmr2); in fmr2_probe()
227 err = v4l2_device_register(pdev, &fmr2->v4l2_dev); in fmr2_probe()
229 v4l2_err(&fmr2->v4l2_dev, "Could not register v4l2_device\n"); in fmr2_probe()
230 release_region(fmr2->io, 2); in fmr2_probe()
233 fmr2->tea.v4l2_dev = &fmr2->v4l2_dev; in fmr2_probe()
234 fmr2->tea.private_data = fmr2; in fmr2_probe()
235 fmr2->tea.radio_nr = radio_nr[num_fmr2_cards]; in fmr2_probe()
236 fmr2->tea.ops = &fmr2_tea_ops; in fmr2_probe()
237 fmr2->tea.ext_init = fmr2_tea_ext_init; in fmr2_probe()
238 strscpy(fmr2->tea.card, card_name, sizeof(fmr2->tea.card)); in fmr2_probe()
239 snprintf(fmr2->tea.bus_info, sizeof(fmr2->tea.bus_info), "%s:%s", in fmr2_probe()
240 fmr2->is_fmd2 ? "PnP" : "ISA", dev_name(pdev)); in fmr2_probe()
242 if (snd_tea575x_init(&fmr2->tea, THIS_MODULE)) { in fmr2_probe()
244 release_region(fmr2->io, 2); in fmr2_probe()
249 card_name, fmr2->io); in fmr2_probe()
255 struct fmr2 *fmr2 = kzalloc(sizeof(*fmr2), GFP_KERNEL); in fmr2_isa_match() local
256 if (!fmr2) in fmr2_isa_match()
259 if (fmr2_probe(fmr2, pdev, FMR2_PORT)) { in fmr2_isa_match()
260 kfree(fmr2); in fmr2_isa_match()
263 dev_set_drvdata(pdev, fmr2); in fmr2_isa_match()
264 fmr2_cards[num_fmr2_cards++] = fmr2; in fmr2_isa_match()
272 struct fmr2 *fmr2 = kzalloc(sizeof(*fmr2), GFP_KERNEL); in fmr2_pnp_probe() local
273 if (!fmr2) in fmr2_pnp_probe()
276 fmr2->is_fmd2 = true; in fmr2_pnp_probe()
277 ret = fmr2_probe(fmr2, &pdev->dev, pnp_port_start(pdev, 0)); in fmr2_pnp_probe()
279 kfree(fmr2); in fmr2_pnp_probe()
282 pnp_set_drvdata(pdev, fmr2); in fmr2_pnp_probe()
283 fmr2_cards[num_fmr2_cards++] = fmr2; in fmr2_pnp_probe()
288 static void fmr2_remove(struct fmr2 *fmr2) in fmr2_remove() argument
290 snd_tea575x_exit(&fmr2->tea); in fmr2_remove()
291 release_region(fmr2->io, 2); in fmr2_remove()
292 v4l2_device_unregister(&fmr2->v4l2_dev); in fmr2_remove()
293 kfree(fmr2); in fmr2_remove()