sound/aoa/codecs/onyx.c
1000
if (onyx_read_register(onyx, ONYX_REG_CONTROL, &dummy) != 0) {
sound/aoa/codecs/onyx.c
1005
strscpy(onyx->codec.name, "onyx");
sound/aoa/codecs/onyx.c
1006
onyx->codec.owner = THIS_MODULE;
sound/aoa/codecs/onyx.c
1007
onyx->codec.init = onyx_init_codec;
sound/aoa/codecs/onyx.c
1008
onyx->codec.exit = onyx_exit_codec;
sound/aoa/codecs/onyx.c
1009
onyx->codec.node = of_node_get(node);
sound/aoa/codecs/onyx.c
1011
if (aoa_codec_register(&onyx->codec)) {
sound/aoa/codecs/onyx.c
1017
of_node_put(onyx->codec.node);
sound/aoa/codecs/onyx.c
1019
kfree(onyx);
sound/aoa/codecs/onyx.c
1025
struct onyx *onyx = i2c_get_clientdata(client);
sound/aoa/codecs/onyx.c
1027
aoa_codec_unregister(&onyx->codec);
sound/aoa/codecs/onyx.c
1028
of_node_put(onyx->codec.node);
sound/aoa/codecs/onyx.c
1029
kfree(onyx->codec_info);
sound/aoa/codecs/onyx.c
1030
kfree(onyx);
sound/aoa/codecs/onyx.c
123
struct onyx *onyx = snd_kcontrol_chip(kcontrol);
sound/aoa/codecs/onyx.c
126
guard(mutex)(&onyx->mutex);
sound/aoa/codecs/onyx.c
127
onyx_read_register(onyx, ONYX_REG_DAC_ATTEN_LEFT, &l);
sound/aoa/codecs/onyx.c
128
onyx_read_register(onyx, ONYX_REG_DAC_ATTEN_RIGHT, &r);
sound/aoa/codecs/onyx.c
139
struct onyx *onyx = snd_kcontrol_chip(kcontrol);
sound/aoa/codecs/onyx.c
149
guard(mutex)(&onyx->mutex);
sound/aoa/codecs/onyx.c
150
onyx_read_register(onyx, ONYX_REG_DAC_ATTEN_LEFT, &l);
sound/aoa/codecs/onyx.c
151
onyx_read_register(onyx, ONYX_REG_DAC_ATTEN_RIGHT, &r);
sound/aoa/codecs/onyx.c
157
onyx_write_register(onyx, ONYX_REG_DAC_ATTEN_LEFT,
sound/aoa/codecs/onyx.c
160
onyx_write_register(onyx, ONYX_REG_DAC_ATTEN_RIGHT,
sound/aoa/codecs/onyx.c
195
struct onyx *onyx = snd_kcontrol_chip(kcontrol);
sound/aoa/codecs/onyx.c
198
guard(mutex)(&onyx->mutex);
sound/aoa/codecs/onyx.c
199
onyx_read_register(onyx, ONYX_REG_ADC_CONTROL, &ig);
sound/aoa/codecs/onyx.c
210
struct onyx *onyx = snd_kcontrol_chip(kcontrol);
sound/aoa/codecs/onyx.c
216
guard(mutex)(&onyx->mutex);
sound/aoa/codecs/onyx.c
217
onyx_read_register(onyx, ONYX_REG_ADC_CONTROL, &v);
sound/aoa/codecs/onyx.c
222
onyx_write_register(onyx, ONYX_REG_ADC_CONTROL, n);
sound/aoa/codecs/onyx.c
247
struct onyx *onyx = snd_kcontrol_chip(kcontrol);
sound/aoa/codecs/onyx.c
250
guard(mutex)(&onyx->mutex);
sound/aoa/codecs/onyx.c
251
onyx_read_register(onyx, ONYX_REG_ADC_CONTROL, &v);
sound/aoa/codecs/onyx.c
258
static void onyx_set_capture_source(struct onyx *onyx, int mic)
sound/aoa/codecs/onyx.c
262
guard(mutex)(&onyx->mutex);
sound/aoa/codecs/onyx.c
263
onyx_read_register(onyx, ONYX_REG_ADC_CONTROL, &v);
sound/aoa/codecs/onyx.c
267
onyx_write_register(onyx, ONYX_REG_ADC_CONTROL, v);
sound/aoa/codecs/onyx.c
305
struct onyx *onyx = snd_kcontrol_chip(kcontrol);
sound/aoa/codecs/onyx.c
308
guard(mutex)(&onyx->mutex);
sound/aoa/codecs/onyx.c
309
onyx_read_register(onyx, ONYX_REG_DAC_CONTROL, &c);
sound/aoa/codecs/onyx.c
320
struct onyx *onyx = snd_kcontrol_chip(kcontrol);
sound/aoa/codecs/onyx.c
324
guard(mutex)(&onyx->mutex);
sound/aoa/codecs/onyx.c
325
if (onyx->analog_locked)
sound/aoa/codecs/onyx.c
328
onyx_read_register(onyx, ONYX_REG_DAC_CONTROL, &v);
sound/aoa/codecs/onyx.c
335
err = onyx_write_register(onyx, ONYX_REG_DAC_CONTROL, c);
sound/aoa/codecs/onyx.c
358
struct onyx *onyx = snd_kcontrol_chip(kcontrol);
sound/aoa/codecs/onyx.c
365
guard(mutex)(&onyx->mutex);
sound/aoa/codecs/onyx.c
366
onyx_read_register(onyx, address, &c);
sound/aoa/codecs/onyx.c
376
struct onyx *onyx = snd_kcontrol_chip(kcontrol);
sound/aoa/codecs/onyx.c
385
guard(mutex)(&onyx->mutex);
sound/aoa/codecs/onyx.c
386
if (spdiflock && onyx->spdif_locked) {
sound/aoa/codecs/onyx.c
390
onyx_read_register(onyx, address, &v);
sound/aoa/codecs/onyx.c
395
err = onyx_write_register(onyx, address, c);
sound/aoa/codecs/onyx.c
474
struct onyx *onyx = snd_kcontrol_chip(kcontrol);
sound/aoa/codecs/onyx.c
477
guard(mutex)(&onyx->mutex);
sound/aoa/codecs/onyx.c
478
onyx_read_register(onyx, ONYX_REG_DIG_INFO1, &v);
sound/aoa/codecs/onyx.c
481
onyx_read_register(onyx, ONYX_REG_DIG_INFO2, &v);
sound/aoa/codecs/onyx.c
484
onyx_read_register(onyx, ONYX_REG_DIG_INFO3, &v);
sound/aoa/codecs/onyx.c
487
onyx_read_register(onyx, ONYX_REG_DIG_INFO4, &v);
sound/aoa/codecs/onyx.c
496
struct onyx *onyx = snd_kcontrol_chip(kcontrol);
sound/aoa/codecs/onyx.c
499
guard(mutex)(&onyx->mutex);
sound/aoa/codecs/onyx.c
500
onyx_read_register(onyx, ONYX_REG_DIG_INFO1, &v);
sound/aoa/codecs/onyx.c
502
onyx_write_register(onyx, ONYX_REG_DIG_INFO1, v);
sound/aoa/codecs/onyx.c
505
onyx_write_register(onyx, ONYX_REG_DIG_INFO2, v);
sound/aoa/codecs/onyx.c
507
onyx_read_register(onyx, ONYX_REG_DIG_INFO3, &v);
sound/aoa/codecs/onyx.c
509
onyx_write_register(onyx, ONYX_REG_DIG_INFO3, v);
sound/aoa/codecs/onyx.c
511
onyx_read_register(onyx, ONYX_REG_DIG_INFO4, &v);
sound/aoa/codecs/onyx.c
513
onyx_write_register(onyx, ONYX_REG_DIG_INFO4, v);
sound/aoa/codecs/onyx.c
518
static int onyx_set_spdif_pcm_rate(struct onyx *onyx, unsigned int rate)
sound/aoa/codecs/onyx.c
536
if (onyx_read_register(onyx, ONYX_REG_DIG_INFO3, &dig_info3))
sound/aoa/codecs/onyx.c
539
if (onyx_write_register(onyx, ONYX_REG_DIG_INFO3, dig_info3))
sound/aoa/codecs/onyx.c
589
static int onyx_register_init(struct onyx *onyx)
sound/aoa/codecs/onyx.c
595
if (!onyx->initialised) {
sound/aoa/codecs/onyx.c
597
if (onyx_read_register(onyx, ONYX_REG_CONTROL, &val))
sound/aoa/codecs/onyx.c
604
regs[i] = onyx->cache[register_map[i]-FIRSTREGISTER];
sound/aoa/codecs/onyx.c
608
if (onyx_write_register(onyx, register_map[i], regs[i]))
sound/aoa/codecs/onyx.c
611
onyx->initialised = 1;
sound/aoa/codecs/onyx.c
64
#define codec_to_onyx(c) container_of(c, struct onyx, codec)
sound/aoa/codecs/onyx.c
67
static int onyx_read_register(struct onyx *onyx, u8 reg, u8 *value)
sound/aoa/codecs/onyx.c
683
struct onyx *onyx = cii->codec_data;
sound/aoa/codecs/onyx.c
686
guard(mutex)(&onyx->mutex);
sound/aoa/codecs/onyx.c
687
onyx_read_register(onyx, ONYX_REG_DIG_INFO4, &v);
sound/aoa/codecs/onyx.c
689
onyx_read_register(onyx, ONYX_REG_DAC_CONTROL, &v);
sound/aoa/codecs/onyx.c
707
struct onyx *onyx = cii->codec_data;
sound/aoa/codecs/onyx.c
709
guard(mutex)(&onyx->mutex);
sound/aoa/codecs/onyx.c
714
onyx_read_register(onyx, ONYX_REG_DAC_CONTROL, &v);
sound/aoa/codecs/onyx.c
715
if (onyx_write_register(onyx,
sound/aoa/codecs/onyx.c
719
onyx->analog_locked = 1;
sound/aoa/codecs/onyx.c
72
*value = onyx->cache[reg-FIRSTREGISTER];
sound/aoa/codecs/onyx.c
727
if (onyx->codec.connected & 2)
sound/aoa/codecs/onyx.c
728
return onyx_set_spdif_pcm_rate(onyx,
sound/aoa/codecs/onyx.c
735
if (onyx_write_register(onyx,
sound/aoa/codecs/onyx.c
739
onyx->spdif_locked = 1;
sound/aoa/codecs/onyx.c
749
struct onyx *onyx = cii->codec_data;
sound/aoa/codecs/onyx.c
75
v = i2c_smbus_read_byte_data(onyx->i2c, reg);
sound/aoa/codecs/onyx.c
751
guard(mutex)(&onyx->mutex);
sound/aoa/codecs/onyx.c
752
onyx->open_count++;
sound/aoa/codecs/onyx.c
760
struct onyx *onyx = cii->codec_data;
sound/aoa/codecs/onyx.c
762
guard(mutex)(&onyx->mutex);
sound/aoa/codecs/onyx.c
763
onyx->open_count--;
sound/aoa/codecs/onyx.c
764
if (!onyx->open_count)
sound/aoa/codecs/onyx.c
765
onyx->spdif_locked = onyx->analog_locked = 0;
sound/aoa/codecs/onyx.c
773
struct onyx *onyx = cii->codec_data;
sound/aoa/codecs/onyx.c
775
guard(mutex)(&onyx->mutex);
sound/aoa/codecs/onyx.c
779
onyx->codec.gpio->methods->all_amps_off(onyx->codec.gpio);
sound/aoa/codecs/onyx.c
782
onyx->codec.gpio->methods->all_amps_restore(onyx->codec.gpio);
sound/aoa/codecs/onyx.c
795
struct onyx *onyx = cii->codec_data;
sound/aoa/codecs/onyx.c
798
guard(mutex)(&onyx->mutex);
sound/aoa/codecs/onyx.c
799
if (onyx_read_register(onyx, ONYX_REG_CONTROL, &v))
sound/aoa/codecs/onyx.c
801
onyx_write_register(onyx, ONYX_REG_CONTROL, v | ONYX_ADPSV | ONYX_DAPSV);
sound/aoa/codecs/onyx.c
808
struct onyx *onyx = cii->codec_data;
sound/aoa/codecs/onyx.c
81
onyx->cache[ONYX_REG_CONTROL-FIRSTREGISTER] = *value;
sound/aoa/codecs/onyx.c
811
guard(mutex)(&onyx->mutex);
sound/aoa/codecs/onyx.c
814
onyx->codec.gpio->methods->set_hw_reset(onyx->codec.gpio, 0);
sound/aoa/codecs/onyx.c
816
onyx->codec.gpio->methods->set_hw_reset(onyx->codec.gpio, 1);
sound/aoa/codecs/onyx.c
818
onyx->codec.gpio->methods->set_hw_reset(onyx->codec.gpio, 0);
sound/aoa/codecs/onyx.c
822
if (onyx_read_register(onyx, ONYX_REG_CONTROL, &v))
sound/aoa/codecs/onyx.c
824
onyx_write_register(onyx, ONYX_REG_CONTROL, v & ~(ONYX_ADPSV | ONYX_DAPSV));
sound/aoa/codecs/onyx.c
828
onyx_register_init(onyx);
sound/aoa/codecs/onyx.c
85
static int onyx_write_register(struct onyx *onyx, u8 reg, u8 value)
sound/aoa/codecs/onyx.c
852
struct onyx *onyx = codec_to_onyx(codec);
sound/aoa/codecs/onyx.c
858
if (!onyx->codec.gpio || !onyx->codec.gpio->methods) {
sound/aoa/codecs/onyx.c
863
onyx->codec.gpio->methods->set_hw_reset(onyx->codec.gpio, 0);
sound/aoa/codecs/onyx.c
865
onyx->codec.gpio->methods->set_hw_reset(onyx->codec.gpio, 1);
sound/aoa/codecs/onyx.c
867
onyx->codec.gpio->methods->set_hw_reset(onyx->codec.gpio, 0);
sound/aoa/codecs/onyx.c
870
if (onyx_register_init(onyx)) {
sound/aoa/codecs/onyx.c
875
if (aoa_snd_device_new(SNDRV_DEV_CODEC, onyx, &ops)) {
sound/aoa/codecs/onyx.c
881
if ((onyx->codec.connected & 0xF) == 0)
sound/aoa/codecs/onyx.c
885
if ((onyx->codec.connected & 0xC) == 0) {
sound/aoa/codecs/onyx.c
886
if (!onyx->codec_info)
sound/aoa/codecs/onyx.c
887
onyx->codec_info = kmalloc_obj(struct codec_info);
sound/aoa/codecs/onyx.c
888
if (!onyx->codec_info)
sound/aoa/codecs/onyx.c
89
result = i2c_smbus_write_byte_data(onyx->i2c, reg, value);
sound/aoa/codecs/onyx.c
890
ci = onyx->codec_info;
sound/aoa/codecs/onyx.c
896
if ((onyx->codec.connected & 3) == 0) {
sound/aoa/codecs/onyx.c
897
if (!onyx->codec_info)
sound/aoa/codecs/onyx.c
898
onyx->codec_info = kmalloc_obj(struct codec_info);
sound/aoa/codecs/onyx.c
899
if (!onyx->codec_info)
sound/aoa/codecs/onyx.c
901
ci = onyx->codec_info;
sound/aoa/codecs/onyx.c
908
if (onyx->codec.soundbus_dev->attach_codec(onyx->codec.soundbus_dev,
sound/aoa/codecs/onyx.c
91
onyx->cache[reg-FIRSTREGISTER] = value;
sound/aoa/codecs/onyx.c
910
ci, onyx)) {
sound/aoa/codecs/onyx.c
916
ctl = snd_ctl_new1(&n, onyx); \
sound/aoa/codecs/onyx.c
919
onyx->codec.soundbus_dev->pcm->device; \
sound/aoa/codecs/onyx.c
926
if (onyx->codec.soundbus_dev->pcm) {
sound/aoa/codecs/onyx.c
929
if ((onyx->codec.connected & 0xC) == 0xC)
sound/aoa/codecs/onyx.c
931
else if (onyx->codec.connected & 4)
sound/aoa/codecs/onyx.c
932
onyx_set_capture_source(onyx, 0);
sound/aoa/codecs/onyx.c
934
onyx_set_capture_source(onyx, 1);
sound/aoa/codecs/onyx.c
935
if (onyx->codec.connected & 0xC)
sound/aoa/codecs/onyx.c
940
if (onyx->codec.connected & 1) {
sound/aoa/codecs/onyx.c
949
if (onyx->codec.connected & 2) {
sound/aoa/codecs/onyx.c
953
if ((onyx->codec.connected & 3) == 3)
sound/aoa/codecs/onyx.c
956
if ((onyx->codec.connected & 3) == 2) {
sound/aoa/codecs/onyx.c
957
onyx_read_register(onyx, ONYX_REG_DIG_INFO4, &v);
sound/aoa/codecs/onyx.c
959
onyx_write_register(onyx, ONYX_REG_DIG_INFO4, v);
sound/aoa/codecs/onyx.c
967
onyx->codec.soundbus_dev->detach_codec(onyx->codec.soundbus_dev, onyx);
sound/aoa/codecs/onyx.c
968
snd_device_free(aoa_get_card(), onyx);
sound/aoa/codecs/onyx.c
974
struct onyx *onyx = codec_to_onyx(codec);
sound/aoa/codecs/onyx.c
976
if (!onyx->codec.soundbus_dev) {
sound/aoa/codecs/onyx.c
980
onyx->codec.soundbus_dev->detach_codec(onyx->codec.soundbus_dev, onyx);
sound/aoa/codecs/onyx.c
986
struct onyx *onyx;
sound/aoa/codecs/onyx.c
989
onyx = kzalloc_obj(struct onyx);
sound/aoa/codecs/onyx.c
991
if (!onyx)
sound/aoa/codecs/onyx.c
994
mutex_init(&onyx->mutex);
sound/aoa/codecs/onyx.c
995
onyx->i2c = client;
sound/aoa/codecs/onyx.c
996
i2c_set_clientdata(client, onyx);