onyx 62 sound/aoa/codecs/onyx.c #define codec_to_onyx(c) container_of(c, struct onyx, codec) onyx 65 sound/aoa/codecs/onyx.c static int onyx_read_register(struct onyx *onyx, u8 reg, u8 *value) onyx 70 sound/aoa/codecs/onyx.c *value = onyx->cache[reg-FIRSTREGISTER]; onyx 73 sound/aoa/codecs/onyx.c v = i2c_smbus_read_byte_data(onyx->i2c, reg); onyx 79 sound/aoa/codecs/onyx.c onyx->cache[ONYX_REG_CONTROL-FIRSTREGISTER] = *value; onyx 83 sound/aoa/codecs/onyx.c static int onyx_write_register(struct onyx *onyx, u8 reg, u8 value) onyx 87 sound/aoa/codecs/onyx.c result = i2c_smbus_write_byte_data(onyx->i2c, reg, value); onyx 89 sound/aoa/codecs/onyx.c onyx->cache[reg-FIRSTREGISTER] = value; onyx 121 sound/aoa/codecs/onyx.c struct onyx *onyx = snd_kcontrol_chip(kcontrol); onyx 124 sound/aoa/codecs/onyx.c mutex_lock(&onyx->mutex); onyx 125 sound/aoa/codecs/onyx.c onyx_read_register(onyx, ONYX_REG_DAC_ATTEN_LEFT, &l); onyx 126 sound/aoa/codecs/onyx.c onyx_read_register(onyx, ONYX_REG_DAC_ATTEN_RIGHT, &r); onyx 127 sound/aoa/codecs/onyx.c mutex_unlock(&onyx->mutex); onyx 138 sound/aoa/codecs/onyx.c struct onyx *onyx = snd_kcontrol_chip(kcontrol); onyx 148 sound/aoa/codecs/onyx.c mutex_lock(&onyx->mutex); onyx 149 sound/aoa/codecs/onyx.c onyx_read_register(onyx, ONYX_REG_DAC_ATTEN_LEFT, &l); onyx 150 sound/aoa/codecs/onyx.c onyx_read_register(onyx, ONYX_REG_DAC_ATTEN_RIGHT, &r); onyx 154 sound/aoa/codecs/onyx.c mutex_unlock(&onyx->mutex); onyx 158 sound/aoa/codecs/onyx.c onyx_write_register(onyx, ONYX_REG_DAC_ATTEN_LEFT, onyx 161 sound/aoa/codecs/onyx.c onyx_write_register(onyx, ONYX_REG_DAC_ATTEN_RIGHT, onyx 164 sound/aoa/codecs/onyx.c mutex_unlock(&onyx->mutex); onyx 197 sound/aoa/codecs/onyx.c struct onyx *onyx = snd_kcontrol_chip(kcontrol); onyx 200 sound/aoa/codecs/onyx.c mutex_lock(&onyx->mutex); onyx 201 sound/aoa/codecs/onyx.c onyx_read_register(onyx, ONYX_REG_ADC_CONTROL, &ig); onyx 202 sound/aoa/codecs/onyx.c mutex_unlock(&onyx->mutex); onyx 213 sound/aoa/codecs/onyx.c struct onyx *onyx = snd_kcontrol_chip(kcontrol); onyx 219 sound/aoa/codecs/onyx.c mutex_lock(&onyx->mutex); onyx 220 sound/aoa/codecs/onyx.c onyx_read_register(onyx, ONYX_REG_ADC_CONTROL, &v); onyx 225 sound/aoa/codecs/onyx.c onyx_write_register(onyx, ONYX_REG_ADC_CONTROL, n); onyx 226 sound/aoa/codecs/onyx.c mutex_unlock(&onyx->mutex); onyx 251 sound/aoa/codecs/onyx.c struct onyx *onyx = snd_kcontrol_chip(kcontrol); onyx 254 sound/aoa/codecs/onyx.c mutex_lock(&onyx->mutex); onyx 255 sound/aoa/codecs/onyx.c onyx_read_register(onyx, ONYX_REG_ADC_CONTROL, &v); onyx 256 sound/aoa/codecs/onyx.c mutex_unlock(&onyx->mutex); onyx 263 sound/aoa/codecs/onyx.c static void onyx_set_capture_source(struct onyx *onyx, int mic) onyx 267 sound/aoa/codecs/onyx.c mutex_lock(&onyx->mutex); onyx 268 sound/aoa/codecs/onyx.c onyx_read_register(onyx, ONYX_REG_ADC_CONTROL, &v); onyx 272 sound/aoa/codecs/onyx.c onyx_write_register(onyx, ONYX_REG_ADC_CONTROL, v); onyx 273 sound/aoa/codecs/onyx.c mutex_unlock(&onyx->mutex); onyx 311 sound/aoa/codecs/onyx.c struct onyx *onyx = snd_kcontrol_chip(kcontrol); onyx 314 sound/aoa/codecs/onyx.c mutex_lock(&onyx->mutex); onyx 315 sound/aoa/codecs/onyx.c onyx_read_register(onyx, ONYX_REG_DAC_CONTROL, &c); onyx 316 sound/aoa/codecs/onyx.c mutex_unlock(&onyx->mutex); onyx 327 sound/aoa/codecs/onyx.c struct onyx *onyx = snd_kcontrol_chip(kcontrol); onyx 331 sound/aoa/codecs/onyx.c mutex_lock(&onyx->mutex); onyx 332 sound/aoa/codecs/onyx.c if (onyx->analog_locked) onyx 335 sound/aoa/codecs/onyx.c onyx_read_register(onyx, ONYX_REG_DAC_CONTROL, &v); onyx 342 sound/aoa/codecs/onyx.c err = onyx_write_register(onyx, ONYX_REG_DAC_CONTROL, c); onyx 345 sound/aoa/codecs/onyx.c mutex_unlock(&onyx->mutex); onyx 368 sound/aoa/codecs/onyx.c struct onyx *onyx = snd_kcontrol_chip(kcontrol); onyx 375 sound/aoa/codecs/onyx.c mutex_lock(&onyx->mutex); onyx 376 sound/aoa/codecs/onyx.c onyx_read_register(onyx, address, &c); onyx 377 sound/aoa/codecs/onyx.c mutex_unlock(&onyx->mutex); onyx 387 sound/aoa/codecs/onyx.c struct onyx *onyx = snd_kcontrol_chip(kcontrol); onyx 396 sound/aoa/codecs/onyx.c mutex_lock(&onyx->mutex); onyx 397 sound/aoa/codecs/onyx.c if (spdiflock && onyx->spdif_locked) { onyx 402 sound/aoa/codecs/onyx.c onyx_read_register(onyx, address, &v); onyx 407 sound/aoa/codecs/onyx.c err = onyx_write_register(onyx, address, c); onyx 410 sound/aoa/codecs/onyx.c mutex_unlock(&onyx->mutex); onyx 489 sound/aoa/codecs/onyx.c struct onyx *onyx = snd_kcontrol_chip(kcontrol); onyx 492 sound/aoa/codecs/onyx.c mutex_lock(&onyx->mutex); onyx 493 sound/aoa/codecs/onyx.c onyx_read_register(onyx, ONYX_REG_DIG_INFO1, &v); onyx 496 sound/aoa/codecs/onyx.c onyx_read_register(onyx, ONYX_REG_DIG_INFO2, &v); onyx 499 sound/aoa/codecs/onyx.c onyx_read_register(onyx, ONYX_REG_DIG_INFO3, &v); onyx 502 sound/aoa/codecs/onyx.c onyx_read_register(onyx, ONYX_REG_DIG_INFO4, &v); onyx 504 sound/aoa/codecs/onyx.c mutex_unlock(&onyx->mutex); onyx 512 sound/aoa/codecs/onyx.c struct onyx *onyx = snd_kcontrol_chip(kcontrol); onyx 515 sound/aoa/codecs/onyx.c mutex_lock(&onyx->mutex); onyx 516 sound/aoa/codecs/onyx.c onyx_read_register(onyx, ONYX_REG_DIG_INFO1, &v); onyx 518 sound/aoa/codecs/onyx.c onyx_write_register(onyx, ONYX_REG_DIG_INFO1, v); onyx 521 sound/aoa/codecs/onyx.c onyx_write_register(onyx, ONYX_REG_DIG_INFO2, v); onyx 523 sound/aoa/codecs/onyx.c onyx_read_register(onyx, ONYX_REG_DIG_INFO3, &v); onyx 525 sound/aoa/codecs/onyx.c onyx_write_register(onyx, ONYX_REG_DIG_INFO3, v); onyx 527 sound/aoa/codecs/onyx.c onyx_read_register(onyx, ONYX_REG_DIG_INFO4, &v); onyx 529 sound/aoa/codecs/onyx.c onyx_write_register(onyx, ONYX_REG_DIG_INFO4, v); onyx 530 sound/aoa/codecs/onyx.c mutex_unlock(&onyx->mutex); onyx 578 sound/aoa/codecs/onyx.c static int onyx_register_init(struct onyx *onyx) onyx 584 sound/aoa/codecs/onyx.c if (!onyx->initialised) { onyx 586 sound/aoa/codecs/onyx.c if (onyx_read_register(onyx, ONYX_REG_CONTROL, &val)) onyx 593 sound/aoa/codecs/onyx.c regs[i] = onyx->cache[register_map[i]-FIRSTREGISTER]; onyx 597 sound/aoa/codecs/onyx.c if (onyx_write_register(onyx, register_map[i], regs[i])) onyx 600 sound/aoa/codecs/onyx.c onyx->initialised = 1; onyx 672 sound/aoa/codecs/onyx.c struct onyx *onyx = cii->codec_data; onyx 675 sound/aoa/codecs/onyx.c mutex_lock(&onyx->mutex); onyx 676 sound/aoa/codecs/onyx.c onyx_read_register(onyx, ONYX_REG_DIG_INFO4, &v); onyx 678 sound/aoa/codecs/onyx.c onyx_read_register(onyx, ONYX_REG_DAC_CONTROL, &v); onyx 682 sound/aoa/codecs/onyx.c mutex_unlock(&onyx->mutex); onyx 697 sound/aoa/codecs/onyx.c struct onyx *onyx = cii->codec_data; onyx 700 sound/aoa/codecs/onyx.c mutex_lock(&onyx->mutex); onyx 705 sound/aoa/codecs/onyx.c onyx_read_register(onyx, ONYX_REG_DAC_CONTROL, &v); onyx 706 sound/aoa/codecs/onyx.c if (onyx_write_register(onyx, onyx 710 sound/aoa/codecs/onyx.c onyx->analog_locked = 1; onyx 728 sound/aoa/codecs/onyx.c if (onyx_write_register(onyx, onyx 732 sound/aoa/codecs/onyx.c onyx->spdif_locked = 1; onyx 738 sound/aoa/codecs/onyx.c mutex_unlock(&onyx->mutex); onyx 746 sound/aoa/codecs/onyx.c struct onyx *onyx = cii->codec_data; onyx 748 sound/aoa/codecs/onyx.c mutex_lock(&onyx->mutex); onyx 749 sound/aoa/codecs/onyx.c onyx->open_count++; onyx 750 sound/aoa/codecs/onyx.c mutex_unlock(&onyx->mutex); onyx 758 sound/aoa/codecs/onyx.c struct onyx *onyx = cii->codec_data; onyx 760 sound/aoa/codecs/onyx.c mutex_lock(&onyx->mutex); onyx 761 sound/aoa/codecs/onyx.c onyx->open_count--; onyx 762 sound/aoa/codecs/onyx.c if (!onyx->open_count) onyx 763 sound/aoa/codecs/onyx.c onyx->spdif_locked = onyx->analog_locked = 0; onyx 764 sound/aoa/codecs/onyx.c mutex_unlock(&onyx->mutex); onyx 772 sound/aoa/codecs/onyx.c struct onyx *onyx = cii->codec_data; onyx 774 sound/aoa/codecs/onyx.c mutex_lock(&onyx->mutex); onyx 778 sound/aoa/codecs/onyx.c onyx->codec.gpio->methods->all_amps_off(onyx->codec.gpio); onyx 781 sound/aoa/codecs/onyx.c onyx->codec.gpio->methods->all_amps_restore(onyx->codec.gpio); onyx 786 sound/aoa/codecs/onyx.c mutex_unlock(&onyx->mutex); onyx 795 sound/aoa/codecs/onyx.c struct onyx *onyx = cii->codec_data; onyx 799 sound/aoa/codecs/onyx.c mutex_lock(&onyx->mutex); onyx 800 sound/aoa/codecs/onyx.c if (onyx_read_register(onyx, ONYX_REG_CONTROL, &v)) onyx 802 sound/aoa/codecs/onyx.c onyx_write_register(onyx, ONYX_REG_CONTROL, v | ONYX_ADPSV | ONYX_DAPSV); onyx 806 sound/aoa/codecs/onyx.c mutex_unlock(&onyx->mutex); onyx 813 sound/aoa/codecs/onyx.c struct onyx *onyx = cii->codec_data; onyx 817 sound/aoa/codecs/onyx.c mutex_lock(&onyx->mutex); onyx 820 sound/aoa/codecs/onyx.c onyx->codec.gpio->methods->set_hw_reset(onyx->codec.gpio, 0); onyx 822 sound/aoa/codecs/onyx.c onyx->codec.gpio->methods->set_hw_reset(onyx->codec.gpio, 1); onyx 824 sound/aoa/codecs/onyx.c onyx->codec.gpio->methods->set_hw_reset(onyx->codec.gpio, 0); onyx 828 sound/aoa/codecs/onyx.c if (onyx_read_register(onyx, ONYX_REG_CONTROL, &v)) onyx 830 sound/aoa/codecs/onyx.c onyx_write_register(onyx, ONYX_REG_CONTROL, v & ~(ONYX_ADPSV | ONYX_DAPSV)); onyx 834 sound/aoa/codecs/onyx.c onyx_register_init(onyx); onyx 837 sound/aoa/codecs/onyx.c mutex_unlock(&onyx->mutex); onyx 862 sound/aoa/codecs/onyx.c struct onyx *onyx = codec_to_onyx(codec); onyx 868 sound/aoa/codecs/onyx.c if (!onyx->codec.gpio || !onyx->codec.gpio->methods) { onyx 873 sound/aoa/codecs/onyx.c onyx->codec.gpio->methods->set_hw_reset(onyx->codec.gpio, 0); onyx 875 sound/aoa/codecs/onyx.c onyx->codec.gpio->methods->set_hw_reset(onyx->codec.gpio, 1); onyx 877 sound/aoa/codecs/onyx.c onyx->codec.gpio->methods->set_hw_reset(onyx->codec.gpio, 0); onyx 880 sound/aoa/codecs/onyx.c if (onyx_register_init(onyx)) { onyx 885 sound/aoa/codecs/onyx.c if (aoa_snd_device_new(SNDRV_DEV_CODEC, onyx, &ops)) { onyx 891 sound/aoa/codecs/onyx.c if ((onyx->codec.connected & 0xF) == 0) onyx 895 sound/aoa/codecs/onyx.c if ((onyx->codec.connected & 0xC) == 0) { onyx 896 sound/aoa/codecs/onyx.c if (!onyx->codec_info) onyx 897 sound/aoa/codecs/onyx.c onyx->codec_info = kmalloc(sizeof(struct codec_info), GFP_KERNEL); onyx 898 sound/aoa/codecs/onyx.c if (!onyx->codec_info) onyx 900 sound/aoa/codecs/onyx.c ci = onyx->codec_info; onyx 906 sound/aoa/codecs/onyx.c if ((onyx->codec.connected & 3) == 0) { onyx 907 sound/aoa/codecs/onyx.c if (!onyx->codec_info) onyx 908 sound/aoa/codecs/onyx.c onyx->codec_info = kmalloc(sizeof(struct codec_info), GFP_KERNEL); onyx 909 sound/aoa/codecs/onyx.c if (!onyx->codec_info) onyx 911 sound/aoa/codecs/onyx.c ci = onyx->codec_info; onyx 918 sound/aoa/codecs/onyx.c if (onyx->codec.soundbus_dev->attach_codec(onyx->codec.soundbus_dev, onyx 920 sound/aoa/codecs/onyx.c ci, onyx)) { onyx 926 sound/aoa/codecs/onyx.c ctl = snd_ctl_new1(&n, onyx); \ onyx 929 sound/aoa/codecs/onyx.c onyx->codec.soundbus_dev->pcm->device; \ onyx 936 sound/aoa/codecs/onyx.c if (onyx->codec.soundbus_dev->pcm) { onyx 939 sound/aoa/codecs/onyx.c if ((onyx->codec.connected & 0xC) == 0xC) onyx 941 sound/aoa/codecs/onyx.c else if (onyx->codec.connected & 4) onyx 942 sound/aoa/codecs/onyx.c onyx_set_capture_source(onyx, 0); onyx 944 sound/aoa/codecs/onyx.c onyx_set_capture_source(onyx, 1); onyx 945 sound/aoa/codecs/onyx.c if (onyx->codec.connected & 0xC) onyx 950 sound/aoa/codecs/onyx.c if (onyx->codec.connected & 1) { onyx 959 sound/aoa/codecs/onyx.c if (onyx->codec.connected & 2) { onyx 963 sound/aoa/codecs/onyx.c if ((onyx->codec.connected & 3) == 3) onyx 966 sound/aoa/codecs/onyx.c if ((onyx->codec.connected & 3) == 2) { onyx 967 sound/aoa/codecs/onyx.c onyx_read_register(onyx, ONYX_REG_DIG_INFO4, &v); onyx 969 sound/aoa/codecs/onyx.c onyx_write_register(onyx, ONYX_REG_DIG_INFO4, v); onyx 977 sound/aoa/codecs/onyx.c onyx->codec.soundbus_dev->detach_codec(onyx->codec.soundbus_dev, onyx); onyx 978 sound/aoa/codecs/onyx.c snd_device_free(aoa_get_card(), onyx); onyx 984 sound/aoa/codecs/onyx.c struct onyx *onyx = codec_to_onyx(codec); onyx 986 sound/aoa/codecs/onyx.c if (!onyx->codec.soundbus_dev) { onyx 990 sound/aoa/codecs/onyx.c onyx->codec.soundbus_dev->detach_codec(onyx->codec.soundbus_dev, onyx); onyx 997 sound/aoa/codecs/onyx.c struct onyx *onyx; onyx 1000 sound/aoa/codecs/onyx.c onyx = kzalloc(sizeof(struct onyx), GFP_KERNEL); onyx 1002 sound/aoa/codecs/onyx.c if (!onyx) onyx 1005 sound/aoa/codecs/onyx.c mutex_init(&onyx->mutex); onyx 1006 sound/aoa/codecs/onyx.c onyx->i2c = client; onyx 1007 sound/aoa/codecs/onyx.c i2c_set_clientdata(client, onyx); onyx 1011 sound/aoa/codecs/onyx.c if (onyx_read_register(onyx, ONYX_REG_CONTROL, &dummy) != 0) { onyx 1016 sound/aoa/codecs/onyx.c strlcpy(onyx->codec.name, "onyx", MAX_CODEC_NAME_LEN); onyx 1017 sound/aoa/codecs/onyx.c onyx->codec.owner = THIS_MODULE; onyx 1018 sound/aoa/codecs/onyx.c onyx->codec.init = onyx_init_codec; onyx 1019 sound/aoa/codecs/onyx.c onyx->codec.exit = onyx_exit_codec; onyx 1020 sound/aoa/codecs/onyx.c onyx->codec.node = of_node_get(node); onyx 1022 sound/aoa/codecs/onyx.c if (aoa_codec_register(&onyx->codec)) { onyx 1028 sound/aoa/codecs/onyx.c kfree(onyx); onyx 1034 sound/aoa/codecs/onyx.c struct onyx *onyx = i2c_get_clientdata(client); onyx 1036 sound/aoa/codecs/onyx.c aoa_codec_unregister(&onyx->codec); onyx 1037 sound/aoa/codecs/onyx.c of_node_put(onyx->codec.node); onyx 1038 sound/aoa/codecs/onyx.c kfree(onyx->codec_info); onyx 1039 sound/aoa/codecs/onyx.c kfree(onyx);