sound/aoa/codecs/onyx.c
122
struct onyx *onyx = snd_kcontrol_chip(kcontrol);
sound/aoa/codecs/onyx.c
125
guard(mutex)(&onyx->mutex);
sound/aoa/codecs/onyx.c
126
onyx_read_register(onyx, ONYX_REG_DAC_ATTEN_LEFT, &l);
sound/aoa/codecs/onyx.c
127
onyx_read_register(onyx, ONYX_REG_DAC_ATTEN_RIGHT, &r);
sound/aoa/codecs/onyx.c
138
struct onyx *onyx = snd_kcontrol_chip(kcontrol);
sound/aoa/codecs/onyx.c
148
guard(mutex)(&onyx->mutex);
sound/aoa/codecs/onyx.c
149
onyx_read_register(onyx, ONYX_REG_DAC_ATTEN_LEFT, &l);
sound/aoa/codecs/onyx.c
150
onyx_read_register(onyx, ONYX_REG_DAC_ATTEN_RIGHT, &r);
sound/aoa/codecs/onyx.c
156
onyx_write_register(onyx, ONYX_REG_DAC_ATTEN_LEFT,
sound/aoa/codecs/onyx.c
159
onyx_write_register(onyx, ONYX_REG_DAC_ATTEN_RIGHT,
sound/aoa/codecs/onyx.c
194
struct onyx *onyx = snd_kcontrol_chip(kcontrol);
sound/aoa/codecs/onyx.c
197
guard(mutex)(&onyx->mutex);
sound/aoa/codecs/onyx.c
198
onyx_read_register(onyx, ONYX_REG_ADC_CONTROL, &ig);
sound/aoa/codecs/onyx.c
209
struct onyx *onyx = snd_kcontrol_chip(kcontrol);
sound/aoa/codecs/onyx.c
215
guard(mutex)(&onyx->mutex);
sound/aoa/codecs/onyx.c
216
onyx_read_register(onyx, ONYX_REG_ADC_CONTROL, &v);
sound/aoa/codecs/onyx.c
221
onyx_write_register(onyx, ONYX_REG_ADC_CONTROL, n);
sound/aoa/codecs/onyx.c
246
struct onyx *onyx = snd_kcontrol_chip(kcontrol);
sound/aoa/codecs/onyx.c
249
guard(mutex)(&onyx->mutex);
sound/aoa/codecs/onyx.c
250
onyx_read_register(onyx, ONYX_REG_ADC_CONTROL, &v);
sound/aoa/codecs/onyx.c
257
static void onyx_set_capture_source(struct onyx *onyx, int mic)
sound/aoa/codecs/onyx.c
261
guard(mutex)(&onyx->mutex);
sound/aoa/codecs/onyx.c
262
onyx_read_register(onyx, ONYX_REG_ADC_CONTROL, &v);
sound/aoa/codecs/onyx.c
266
onyx_write_register(onyx, ONYX_REG_ADC_CONTROL, v);
sound/aoa/codecs/onyx.c
304
struct onyx *onyx = snd_kcontrol_chip(kcontrol);
sound/aoa/codecs/onyx.c
307
guard(mutex)(&onyx->mutex);
sound/aoa/codecs/onyx.c
308
onyx_read_register(onyx, ONYX_REG_DAC_CONTROL, &c);
sound/aoa/codecs/onyx.c
319
struct onyx *onyx = snd_kcontrol_chip(kcontrol);
sound/aoa/codecs/onyx.c
323
guard(mutex)(&onyx->mutex);
sound/aoa/codecs/onyx.c
324
if (onyx->analog_locked)
sound/aoa/codecs/onyx.c
327
onyx_read_register(onyx, ONYX_REG_DAC_CONTROL, &v);
sound/aoa/codecs/onyx.c
334
err = onyx_write_register(onyx, ONYX_REG_DAC_CONTROL, c);
sound/aoa/codecs/onyx.c
357
struct onyx *onyx = snd_kcontrol_chip(kcontrol);
sound/aoa/codecs/onyx.c
364
guard(mutex)(&onyx->mutex);
sound/aoa/codecs/onyx.c
365
onyx_read_register(onyx, address, &c);
sound/aoa/codecs/onyx.c
375
struct onyx *onyx = snd_kcontrol_chip(kcontrol);
sound/aoa/codecs/onyx.c
384
guard(mutex)(&onyx->mutex);
sound/aoa/codecs/onyx.c
385
if (spdiflock && onyx->spdif_locked) {
sound/aoa/codecs/onyx.c
389
onyx_read_register(onyx, address, &v);
sound/aoa/codecs/onyx.c
394
err = onyx_write_register(onyx, address, c);
sound/aoa/codecs/onyx.c
473
struct onyx *onyx = snd_kcontrol_chip(kcontrol);
sound/aoa/codecs/onyx.c
476
guard(mutex)(&onyx->mutex);
sound/aoa/codecs/onyx.c
477
onyx_read_register(onyx, ONYX_REG_DIG_INFO1, &v);
sound/aoa/codecs/onyx.c
480
onyx_read_register(onyx, ONYX_REG_DIG_INFO2, &v);
sound/aoa/codecs/onyx.c
483
onyx_read_register(onyx, ONYX_REG_DIG_INFO3, &v);
sound/aoa/codecs/onyx.c
486
onyx_read_register(onyx, ONYX_REG_DIG_INFO4, &v);
sound/aoa/codecs/onyx.c
495
struct onyx *onyx = snd_kcontrol_chip(kcontrol);
sound/aoa/codecs/onyx.c
498
guard(mutex)(&onyx->mutex);
sound/aoa/codecs/onyx.c
499
onyx_read_register(onyx, ONYX_REG_DIG_INFO1, &v);
sound/aoa/codecs/onyx.c
501
onyx_write_register(onyx, ONYX_REG_DIG_INFO1, v);
sound/aoa/codecs/onyx.c
504
onyx_write_register(onyx, ONYX_REG_DIG_INFO2, v);
sound/aoa/codecs/onyx.c
506
onyx_read_register(onyx, ONYX_REG_DIG_INFO3, &v);
sound/aoa/codecs/onyx.c
508
onyx_write_register(onyx, ONYX_REG_DIG_INFO3, v);
sound/aoa/codecs/onyx.c
510
onyx_read_register(onyx, ONYX_REG_DIG_INFO4, &v);
sound/aoa/codecs/onyx.c
512
onyx_write_register(onyx, ONYX_REG_DIG_INFO4, v);
sound/aoa/codecs/onyx.c
560
static int onyx_register_init(struct onyx *onyx)
sound/aoa/codecs/onyx.c
566
if (!onyx->initialised) {
sound/aoa/codecs/onyx.c
568
if (onyx_read_register(onyx, ONYX_REG_CONTROL, &val))
sound/aoa/codecs/onyx.c
575
regs[i] = onyx->cache[register_map[i]-FIRSTREGISTER];
sound/aoa/codecs/onyx.c
579
if (onyx_write_register(onyx, register_map[i], regs[i]))
sound/aoa/codecs/onyx.c
582
onyx->initialised = 1;
sound/aoa/codecs/onyx.c
63
#define codec_to_onyx(c) container_of(c, struct onyx, codec)
sound/aoa/codecs/onyx.c
654
struct onyx *onyx = cii->codec_data;
sound/aoa/codecs/onyx.c
657
guard(mutex)(&onyx->mutex);
sound/aoa/codecs/onyx.c
658
onyx_read_register(onyx, ONYX_REG_DIG_INFO4, &v);
sound/aoa/codecs/onyx.c
66
static int onyx_read_register(struct onyx *onyx, u8 reg, u8 *value)
sound/aoa/codecs/onyx.c
660
onyx_read_register(onyx, ONYX_REG_DAC_CONTROL, &v);
sound/aoa/codecs/onyx.c
678
struct onyx *onyx = cii->codec_data;
sound/aoa/codecs/onyx.c
680
guard(mutex)(&onyx->mutex);
sound/aoa/codecs/onyx.c
685
onyx_read_register(onyx, ONYX_REG_DAC_CONTROL, &v);
sound/aoa/codecs/onyx.c
686
if (onyx_write_register(onyx,
sound/aoa/codecs/onyx.c
690
onyx->analog_locked = 1;
sound/aoa/codecs/onyx.c
706
if (onyx_write_register(onyx,
sound/aoa/codecs/onyx.c
71
*value = onyx->cache[reg-FIRSTREGISTER];
sound/aoa/codecs/onyx.c
710
onyx->spdif_locked = 1;
sound/aoa/codecs/onyx.c
720
struct onyx *onyx = cii->codec_data;
sound/aoa/codecs/onyx.c
722
guard(mutex)(&onyx->mutex);
sound/aoa/codecs/onyx.c
723
onyx->open_count++;
sound/aoa/codecs/onyx.c
731
struct onyx *onyx = cii->codec_data;
sound/aoa/codecs/onyx.c
733
guard(mutex)(&onyx->mutex);
sound/aoa/codecs/onyx.c
734
onyx->open_count--;
sound/aoa/codecs/onyx.c
735
if (!onyx->open_count)
sound/aoa/codecs/onyx.c
736
onyx->spdif_locked = onyx->analog_locked = 0;
sound/aoa/codecs/onyx.c
74
v = i2c_smbus_read_byte_data(onyx->i2c, reg);
sound/aoa/codecs/onyx.c
744
struct onyx *onyx = cii->codec_data;
sound/aoa/codecs/onyx.c
746
guard(mutex)(&onyx->mutex);
sound/aoa/codecs/onyx.c
750
onyx->codec.gpio->methods->all_amps_off(onyx->codec.gpio);
sound/aoa/codecs/onyx.c
753
onyx->codec.gpio->methods->all_amps_restore(onyx->codec.gpio);
sound/aoa/codecs/onyx.c
766
struct onyx *onyx = cii->codec_data;
sound/aoa/codecs/onyx.c
769
guard(mutex)(&onyx->mutex);
sound/aoa/codecs/onyx.c
770
if (onyx_read_register(onyx, ONYX_REG_CONTROL, &v))
sound/aoa/codecs/onyx.c
772
onyx_write_register(onyx, ONYX_REG_CONTROL, v | ONYX_ADPSV | ONYX_DAPSV);
sound/aoa/codecs/onyx.c
779
struct onyx *onyx = cii->codec_data;
sound/aoa/codecs/onyx.c
782
guard(mutex)(&onyx->mutex);
sound/aoa/codecs/onyx.c
785
onyx->codec.gpio->methods->set_hw_reset(onyx->codec.gpio, 0);
sound/aoa/codecs/onyx.c
787
onyx->codec.gpio->methods->set_hw_reset(onyx->codec.gpio, 1);
sound/aoa/codecs/onyx.c
789
onyx->codec.gpio->methods->set_hw_reset(onyx->codec.gpio, 0);
sound/aoa/codecs/onyx.c
793
if (onyx_read_register(onyx, ONYX_REG_CONTROL, &v))
sound/aoa/codecs/onyx.c
795
onyx_write_register(onyx, ONYX_REG_CONTROL, v & ~(ONYX_ADPSV | ONYX_DAPSV));
sound/aoa/codecs/onyx.c
799
onyx_register_init(onyx);
sound/aoa/codecs/onyx.c
80
onyx->cache[ONYX_REG_CONTROL-FIRSTREGISTER] = *value;
sound/aoa/codecs/onyx.c
823
struct onyx *onyx = codec_to_onyx(codec);
sound/aoa/codecs/onyx.c
829
if (!onyx->codec.gpio || !onyx->codec.gpio->methods) {
sound/aoa/codecs/onyx.c
834
onyx->codec.gpio->methods->set_hw_reset(onyx->codec.gpio, 0);
sound/aoa/codecs/onyx.c
836
onyx->codec.gpio->methods->set_hw_reset(onyx->codec.gpio, 1);
sound/aoa/codecs/onyx.c
838
onyx->codec.gpio->methods->set_hw_reset(onyx->codec.gpio, 0);
sound/aoa/codecs/onyx.c
84
static int onyx_write_register(struct onyx *onyx, u8 reg, u8 value)
sound/aoa/codecs/onyx.c
841
if (onyx_register_init(onyx)) {
sound/aoa/codecs/onyx.c
846
if (aoa_snd_device_new(SNDRV_DEV_CODEC, onyx, &ops)) {
sound/aoa/codecs/onyx.c
852
if ((onyx->codec.connected & 0xF) == 0)
sound/aoa/codecs/onyx.c
856
if ((onyx->codec.connected & 0xC) == 0) {
sound/aoa/codecs/onyx.c
857
if (!onyx->codec_info)
sound/aoa/codecs/onyx.c
858
onyx->codec_info = kmalloc_obj(struct codec_info);
sound/aoa/codecs/onyx.c
859
if (!onyx->codec_info)
sound/aoa/codecs/onyx.c
861
ci = onyx->codec_info;
sound/aoa/codecs/onyx.c
867
if ((onyx->codec.connected & 3) == 0) {
sound/aoa/codecs/onyx.c
868
if (!onyx->codec_info)
sound/aoa/codecs/onyx.c
869
onyx->codec_info = kmalloc_obj(struct codec_info);
sound/aoa/codecs/onyx.c
870
if (!onyx->codec_info)
sound/aoa/codecs/onyx.c
872
ci = onyx->codec_info;
sound/aoa/codecs/onyx.c
879
if (onyx->codec.soundbus_dev->attach_codec(onyx->codec.soundbus_dev,
sound/aoa/codecs/onyx.c
88
result = i2c_smbus_write_byte_data(onyx->i2c, reg, value);
sound/aoa/codecs/onyx.c
881
ci, onyx)) {
sound/aoa/codecs/onyx.c
887
ctl = snd_ctl_new1(&n, onyx); \
sound/aoa/codecs/onyx.c
890
onyx->codec.soundbus_dev->pcm->device; \
sound/aoa/codecs/onyx.c
897
if (onyx->codec.soundbus_dev->pcm) {
sound/aoa/codecs/onyx.c
90
onyx->cache[reg-FIRSTREGISTER] = value;
sound/aoa/codecs/onyx.c
900
if ((onyx->codec.connected & 0xC) == 0xC)
sound/aoa/codecs/onyx.c
902
else if (onyx->codec.connected & 4)
sound/aoa/codecs/onyx.c
903
onyx_set_capture_source(onyx, 0);
sound/aoa/codecs/onyx.c
905
onyx_set_capture_source(onyx, 1);
sound/aoa/codecs/onyx.c
906
if (onyx->codec.connected & 0xC)
sound/aoa/codecs/onyx.c
911
if (onyx->codec.connected & 1) {
sound/aoa/codecs/onyx.c
920
if (onyx->codec.connected & 2) {
sound/aoa/codecs/onyx.c
924
if ((onyx->codec.connected & 3) == 3)
sound/aoa/codecs/onyx.c
927
if ((onyx->codec.connected & 3) == 2) {
sound/aoa/codecs/onyx.c
928
onyx_read_register(onyx, ONYX_REG_DIG_INFO4, &v);
sound/aoa/codecs/onyx.c
930
onyx_write_register(onyx, ONYX_REG_DIG_INFO4, v);
sound/aoa/codecs/onyx.c
938
onyx->codec.soundbus_dev->detach_codec(onyx->codec.soundbus_dev, onyx);
sound/aoa/codecs/onyx.c
939
snd_device_free(aoa_get_card(), onyx);
sound/aoa/codecs/onyx.c
945
struct onyx *onyx = codec_to_onyx(codec);
sound/aoa/codecs/onyx.c
947
if (!onyx->codec.soundbus_dev) {
sound/aoa/codecs/onyx.c
951
onyx->codec.soundbus_dev->detach_codec(onyx->codec.soundbus_dev, onyx);
sound/aoa/codecs/onyx.c
957
struct onyx *onyx;
sound/aoa/codecs/onyx.c
960
onyx = kzalloc_obj(struct onyx);
sound/aoa/codecs/onyx.c
962
if (!onyx)
sound/aoa/codecs/onyx.c
965
mutex_init(&onyx->mutex);
sound/aoa/codecs/onyx.c
966
onyx->i2c = client;
sound/aoa/codecs/onyx.c
967
i2c_set_clientdata(client, onyx);
sound/aoa/codecs/onyx.c
971
if (onyx_read_register(onyx, ONYX_REG_CONTROL, &dummy) != 0) {
sound/aoa/codecs/onyx.c
976
strscpy(onyx->codec.name, "onyx");
sound/aoa/codecs/onyx.c
977
onyx->codec.owner = THIS_MODULE;
sound/aoa/codecs/onyx.c
978
onyx->codec.init = onyx_init_codec;
sound/aoa/codecs/onyx.c
979
onyx->codec.exit = onyx_exit_codec;
sound/aoa/codecs/onyx.c
980
onyx->codec.node = of_node_get(node);
sound/aoa/codecs/onyx.c
982
if (aoa_codec_register(&onyx->codec)) {
sound/aoa/codecs/onyx.c
988
kfree(onyx);
sound/aoa/codecs/onyx.c
994
struct onyx *onyx = i2c_get_clientdata(client);
sound/aoa/codecs/onyx.c
996
aoa_codec_unregister(&onyx->codec);
sound/aoa/codecs/onyx.c
997
of_node_put(onyx->codec.node);
sound/aoa/codecs/onyx.c
998
kfree(onyx->codec_info);
sound/aoa/codecs/onyx.c
999
kfree(onyx);