Lines Matching +full:mute +full:- +full:enable
1 // SPDX-License-Identifier: GPL-2.0-only
18 * Converted to the radio-isa framework by Hans Verkuil <hans.verkuil@cisco.com>
23 * Fully tested with the Keene USB FM Transmitter and the v4l2-compliance tool.
35 #include <media/v4l2-ioctl.h>
36 #include <media/v4l2-device.h>
37 #include "radio-isa.h"
53 #define CONFIG_RADIO_GEMTEK_PORT -1
64 [1 ... (GEMTEK_MAX - 1)] = -1 };
65 static int radio_nr[GEMTEK_MAX] = { [0 ... (GEMTEK_MAX - 1)] = -1 };
68 MODULE_PARM_DESC(probe, "Enable automatic device probing.");
71 MODULE_PARM_DESC(hardmute, "Enable 'hard muting' by shutting down PLL, may reduce static noise.");
89 #define GEMTEK_CE 0x04 /* Chip enable */
91 #define GEMTEK_MT 0x10 /* Line mute */
128 #define MKMASK(field) (((1UL<<BU2614_##field##_BITS) - 1) << \
144 #define gemtek_bu2614_set(dev, field, data) ((dev)->bu2614data = \
145 ((dev)->bu2614data & ~field##_MASK) | ((data) << field##_SHIFT))
152 struct radio_isa_card *isa = >->isa; in gemtek_bu2614_transmit()
153 int i, bit, q, mute; in gemtek_bu2614_transmit() local
155 mute = gt->muted ? GEMTEK_MT : 0x00; in gemtek_bu2614_transmit()
157 outb_p(mute | GEMTEK_CE | GEMTEK_DA | GEMTEK_CK, isa->io); in gemtek_bu2614_transmit()
160 for (i = 0, q = gt->bu2614data; i < 32; i++, q >>= 1) { in gemtek_bu2614_transmit()
162 outb_p(mute | GEMTEK_CE | bit, isa->io); in gemtek_bu2614_transmit()
164 outb_p(mute | GEMTEK_CE | bit | GEMTEK_CK, isa->io); in gemtek_bu2614_transmit()
168 outb_p(mute | GEMTEK_DA | GEMTEK_CK, isa->io); in gemtek_bu2614_transmit()
173 * Calculate divisor from FM-frequency for BU2614FS (3.125 KHz STDF expected).
185 gt->muted = true; in gemtek_alloc()
186 return gt ? >->isa : NULL; in gemtek_alloc()
190 * Set FM-frequency.
196 if (hardmute && gt->muted) in gemtek_s_frequency()
201 gemtek_bu2614_set(gt, BU2614_SWIN, 0); /* FM-mode */ in gemtek_s_frequency()
212 * Set mute flag.
214 static int gemtek_s_mute_volume(struct radio_isa_card *isa, bool mute, int vol) in gemtek_s_mute_volume() argument
219 gt->muted = mute; in gemtek_s_mute_volume()
221 if (!mute) in gemtek_s_mute_volume()
222 return gemtek_s_frequency(isa, isa->freq); in gemtek_s_mute_volume()
227 gemtek_bu2614_set(gt, BU2614_SWIN, 0); /* FM-mode */ in gemtek_s_mute_volume()
238 i = inb_p(isa->io); in gemtek_s_mute_volume()
239 /* Write it back with mute flag set. */ in gemtek_s_mute_volume()
240 outb_p((i >> 5) | (mute ? GEMTEK_MT : 0), isa->io); in gemtek_s_mute_volume()
247 if (inb_p(isa->io) & GEMTEK_NS) in gemtek_g_rxsubchans()
286 /* AOpen FX-3D/Pro Radio */
300 .name = "radio-gemtek",
305 .name = "radio-gemtek",