123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581 |
- /*
- * ALSA SoC ES7210 adc driver
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.^M
- *
- * Notes:
- * ES7210 is a 4-ch ADC of Everest
- * This file is used for snd_soc_controls for es7210, such as
- * PGA gain control, mute, volume and suspend
- */
- static const DECLARE_TLV_DB_SCALE(mic_boost_tlv, 0, 300, 0);
- static const DECLARE_TLV_DB_SCALE(direct_gain_tlv, -9550, 50, 0);
- #if ES7210_CHANNELS_MAX > 0
- static int es7210_micboost1_setting_set(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- es7210_update_bits(0x43,
- 0x0F,
- ucontrol->value.integer.value[0] & 0x0f, i2c_clt1[0]);
- return 0;
- }
- static int es7210_micboost1_setting_get(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- u8 val;
- es7210_read(0x43, &val, i2c_clt1[0]);
- ucontrol->value.integer.value[0] = val & 0x0f;
- return 0;
- }
- static int es7210_micboost2_setting_set(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- es7210_update_bits(0x44,
- 0x0F,
- ucontrol->value.integer.value[0] & 0x0f, i2c_clt1[0]);
- return 0;
- }
- static int es7210_micboost2_setting_get(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- u8 val;
- es7210_read(0x44, &val, i2c_clt1[0]);
- ucontrol->value.integer.value[0] = val & 0x0f;
- return 0;
- }
- static int es7210_micboost3_setting_set(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- es7210_update_bits(0x45,
- 0x0F,
- ucontrol->value.integer.value[0] & 0x0f, i2c_clt1[0]);
- return 0;
- }
- static int es7210_micboost3_setting_get(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- u8 val;
- es7210_read(0x45, &val, i2c_clt1[0]);
- ucontrol->value.integer.value[0] = val & 0x0f;
- return 0;
- }
- static int es7210_micboost4_setting_set(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- es7210_update_bits(0x46,
- 0x0F,
- ucontrol->value.integer.value[0] & 0x0f, i2c_clt1[0]);
- return 0;
- }
- static int es7210_micboost4_setting_get(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- u8 val;
- es7210_read(0x46, &val, i2c_clt1[0]);
- ucontrol->value.integer.value[0] = val & 0x0f;
- return 0;
- }
- static int es7210_adc1_mute_set(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- es7210_update_bits(ES7210_ADC12_MUTE_REG15,
- 0x01,
- ucontrol->value.integer.value[0] & 0x01,
- i2c_clt1[0]);
- return 0;
- }
- static int es7210_adc1_mute_get(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- u8 val;
- es7210_read(ES7210_ADC12_MUTE_REG15, &val, i2c_clt1[0]);
- ucontrol->value.integer.value[0] = val & 0x01;
- return 0;
- }
- static int es7210_adc2_mute_set(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- es7210_update_bits(ES7210_ADC12_MUTE_REG15,
- 0x02,
- (ucontrol->value.integer.value[0] & 0x01) << 1,
- i2c_clt1[0]);
- return 0;
- }
- static int es7210_adc2_mute_get(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- u8 val;
- es7210_read(ES7210_ADC12_MUTE_REG15, &val, i2c_clt1[0]);
- ucontrol->value.integer.value[0] = (val & 0x02) >> 1;
- return 0;
- }
- static int es7210_adc3_mute_set(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- es7210_update_bits(ES7210_ADC34_MUTE_REG14,
- 0x01,
- ucontrol->value.integer.value[0] & 0x01,
- i2c_clt1[0]);
- return 0;
- }
- static int es7210_adc3_mute_get(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- u8 val;
- es7210_read(ES7210_ADC34_MUTE_REG14, &val, i2c_clt1[0]);
- ucontrol->value.integer.value[0] = val & 0x01;
- return 0;
- }
- static int es7210_adc4_mute_set(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- es7210_update_bits(ES7210_ADC34_MUTE_REG14,
- 0x02,
- (ucontrol->value.integer.value[0] & 0x01) << 1,
- i2c_clt1[0]);
- return 0;
- }
- static int es7210_adc4_mute_get(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- u8 val;
- es7210_read(ES7210_ADC34_MUTE_REG14, &val, i2c_clt1[0]);
- ucontrol->value.integer.value[0] = (val & 0x02) >> 1;
- return 0;
- }
- static int es7210_adc12_suspend_set(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- u8 val;
- if ((ucontrol->value.integer.value[0] & 0x01) == 1) { //suspend
- es7210_update_bits(0x4b, 0xff, 0xff, i2c_clt1[0]);
- es7210_update_bits(0x01, 0x2a, 0x2a, i2c_clt1[0]);
- } else {
- es7210_update_bits(0x4b, 0xff, 0x00, i2c_clt1[0]);
- es7210_read(0x01, &val, i2c_clt1[0]);
- val &= 0x34;
- es7210_write(0x01, val, i2c_clt1[0]);
- }
- return 0;
- }
- static int es7210_adc12_suspend_get(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- u8 val;
- es7210_read(0x4b, &val, i2c_clt1[0]);
- ucontrol->value.integer.value[0] = val & 0x01;
- return 0;
- }
- static int es7210_adc34_suspend_set(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- u8 val;
- if ((ucontrol->value.integer.value[0] & 0x01) == 1) { //suspend
- es7210_update_bits(0x4c, 0xff, 0xff, i2c_clt1[0]);
- es7210_update_bits(0x01, 0x34, 0x34, i2c_clt1[0]);
- } else {
- es7210_update_bits(0x4c, 0xff, 0x00, i2c_clt1[0]);
- es7210_read(0x01, &val, i2c_clt1[0]);
- val &= 0x2a;
- es7210_write(0x01, val, i2c_clt1[0]);
- }
- return 0;
- }
- static int es7210_adc34_suspend_get(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- u8 val;
- es7210_read(0x4c, &val, i2c_clt1[0]);
- ucontrol->value.integer.value[0] = val & 0x01;
- return 0;
- }
- #endif
- #if ES7210_CHANNELS_MAX > 4
- static int es7210_micboost5_setting_set(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- es7210_update_bits(0x43,
- 0x0F,
- ucontrol->value.integer.value[0] & 0x0f, i2c_clt1[1]);
- return 0;
- }
- static int es7210_micboost5_setting_get(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- u8 val;
- es7210_read(0x43, &val, i2c_clt1[1]);
- ucontrol->value.integer.value[0] = val & 0x0f;
- return 0;
- }
- static int es7210_micboost6_setting_set(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- es7210_update_bits(0x44,
- 0x0F,
- ucontrol->value.integer.value[0] & 0x0f, i2c_clt1[1]);
- return 0;
- }
- static int es7210_micboost6_setting_get(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- u8 val;
- es7210_read(0x44, &val, i2c_clt1[1]);
- ucontrol->value.integer.value[0] = val & 0x0f;
- return 0;
- }
- static int es7210_micboost7_setting_set(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- es7210_update_bits(0x45,
- 0x0F,
- ucontrol->value.integer.value[0] & 0x0f, i2c_clt1[1]);
- return 0;
- }
- static int es7210_micboost7_setting_get(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- u8 val;
- es7210_read(0x45, &val, i2c_clt1[1]);
- ucontrol->value.integer.value[0] = val & 0x0f;
- return 0;
- }
- static int es7210_micboost8_setting_set(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- es7210_update_bits(0x46,
- 0x0F,
- ucontrol->value.integer.value[0] & 0x0f, i2c_clt1[1]);
- return 0;
- }
- static int es7210_micboost8_setting_get(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- u8 val;
- es7210_read(0x46, &val, i2c_clt1[1]);
- ucontrol->value.integer.value[0] = val & 0x0f;
- return 0;
- }
- static int es7210_adc5_mute_set(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- es7210_update_bits(ES7210_ADC12_MUTE_REG15,
- 0x01,
- ucontrol->value.integer.value[0] & 0x01,
- i2c_clt1[1]);
- return 0;
- }
- static int es7210_adc5_mute_get(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- u8 val;
- es7210_read(ES7210_ADC12_MUTE_REG15, &val, i2c_clt1[1]);
- ucontrol->value.integer.value[0] = val & 0x01;
- return 0;
- }
- static int es7210_adc6_mute_set(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- es7210_update_bits(ES7210_ADC12_MUTE_REG15,
- 0x02,
- (ucontrol->value.integer.value[0] & 0x01) << 1,
- i2c_clt1[1]);
- return 0;
- }
- static int es7210_adc6_mute_get(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- u8 val;
- es7210_read(ES7210_ADC12_MUTE_REG15, &val, i2c_clt1[1]);
- ucontrol->value.integer.value[0] = (val & 0x02) >> 1;
- return 0;
- }
- static int es7210_adc7_mute_set(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- es7210_update_bits(ES7210_ADC34_MUTE_REG14,
- 0x01,
- ucontrol->value.integer.value[0] & 0x01,
- i2c_clt1[1]);
- return 0;
- }
- static int es7210_adc7_mute_get(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- u8 val;
- es7210_read(ES7210_ADC34_MUTE_REG14, &val, i2c_clt1[1]);
- ucontrol->value.integer.value[0] = val & 0x01;
- return 0;
- }
- static int es7210_adc8_mute_set(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- es7210_update_bits(ES7210_ADC34_MUTE_REG14,
- 0x02,
- (ucontrol->value.integer.value[0] & 0x01) << 1,
- i2c_clt1[1]);
- return 0;
- }
- static int es7210_adc8_mute_get(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- u8 val;
- es7210_read(ES7210_ADC34_MUTE_REG14, &val, i2c_clt1[1]);
- ucontrol->value.integer.value[0] = (val & 0x02) >> 1;
- return 0;
- }
- static int es7210_adc56_suspend_set(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- u8 val;
- if ((ucontrol->value.integer.value[0] & 0x01) == 1) { //suspend
- es7210_update_bits(0x4b, 0xff, 0xff, i2c_clt1[1]);
- es7210_update_bits(0x01, 0x2a, 0x2a, i2c_clt1[1]);
- } else {
- es7210_update_bits(0x4b, 0xff, 0x00, i2c_clt1[1]);
- es7210_read(0x01, &val, i2c_clt1[1]);
- val &= 0x34;
- es7210_write(0x01, val, i2c_clt1[1]);
- }
- return 0;
- }
- static int es7210_adc56_suspend_get(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- u8 val;
- es7210_read(0x4b, &val, i2c_clt1[1]);
- ucontrol->value.integer.value[0] = val & 0x01;
- return 0;
- }
- static int es7210_adc78_suspend_set(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- u8 val;
- if ((ucontrol->value.integer.value[0] & 0x01) == 1) { //suspend
- es7210_update_bits(0x4c, 0xff, 0xff, i2c_clt1[1]);
- es7210_update_bits(0x01, 0x34, 0x34, i2c_clt1[1]);
- } else {
- es7210_update_bits(0x4c, 0xff, 0x00, i2c_clt1[1]);
- es7210_read(0x01, &val, i2c_clt1[1]);
- val &= 0x2a;
- es7210_write(0x01, val, i2c_clt1[1]);
- }
- return 0;
- }
- static int es7210_adc78_suspend_get(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- u8 val;
- es7210_read(0x4c, &val, i2c_clt1[1]);
- ucontrol->value.integer.value[0] = val & 0x01;
- return 0;
- }
- #endif
- #if ES7210_CHANNELS_MAX > 8
- static int es7210_micboost9_setting_set(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- es7210_update_bits(0x43,
- 0x0F,
- ucontrol->value.integer.value[0] & 0x0f, i2c_clt1[2]);
- return 0;
- }
- static int es7210_micboost9_setting_get(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- u8 val;
- es7210_read(0x43, &val, i2c_clt1[2]);
- ucontrol->value.integer.value[0] = val & 0x0f;
- return 0;
- }
- static int es7210_micboost10_setting_set(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- es7210_update_bits(0x44,
- 0x0F,
- ucontrol->value.integer.value[0] & 0x0f, i2c_clt1[2]);
- return 0;
- }
- static int es7210_micboost10_setting_get(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- u8 val;
- es7210_read(0x44, &val, i2c_clt1[2]);
- ucontrol->value.integer.value[0] = val & 0x0f;
- return 0;
- }
- static int es7210_micboost11_setting_set(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- es7210_update_bits(0x45,
- 0x0F,
- ucontrol->value.integer.value[0] & 0x0f, i2c_clt1[2]);
- return 0;
- }
- static int es7210_micboost11_setting_get(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- u8 val;
- es7210_read(0x45, &val, i2c_clt1[2]);
- ucontrol->value.integer.value[0] = val & 0x0f;
- return 0;
- }
- static int es7210_micboost12_setting_set(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- es7210_update_bits(0x46,
- 0x0F,
- ucontrol->value.integer.value[0] & 0x0f, i2c_clt1[2]);
- return 0;
- }
- static int es7210_micboost12_setting_get(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- u8 val;
- es7210_read(0x46, &val, i2c_clt1[2]);
- ucontrol->value.integer.value[0] = val & 0x0f;
- return 0;
- }
- static int es7210_adc9_mute_set(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- es7210_update_bits(ES7210_ADC12_MUTE_REG15, 0x01,
- ucontrol->value.integer.value[0] & 0x01,
- i2c_clt1[2]);
- return 0;
- }
- static int es7210_adc9_mute_get(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- u8 val;
- es7210_read(ES7210_ADC12_MUTE_REG15, &val, i2c_clt1[2]);
- ucontrol->value.integer.value[0] = val & 0x01;
- return 0;
- }
- static int es7210_adc10_mute_set(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- es7210_update_bits(ES7210_ADC12_MUTE_REG15,
- 0x02,
- (ucontrol->value.integer.value[0] & 0x01) << 1,
- i2c_clt1[2]);
- return 0;
- }
- static int es7210_adc10_mute_get(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- u8 val;
- es7210_read(ES7210_ADC12_MUTE_REG15, &val, i2c_clt1[2]);
- ucontrol->value.integer.value[0] = (val & 0x02) >> 1;
- return 0;
- }
- static int es7210_adc11_mute_set(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- es7210_update_bits(ES7210_ADC34_MUTE_REG14,
- 0x01,
- ucontrol->value.integer.value[0] & 0x01,
- i2c_clt1[2]);
- return 0;
- }
- static int es7210_adc11_mute_get(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- u8 val;
- es7210_read(ES7210_ADC34_MUTE_REG14, &val, i2c_clt1[2]);
- ucontrol->value.integer.value[0] = val & 0x01;
- return 0;
- }
- static int es7210_adc12_mute_set(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- es7210_update_bits(ES7210_ADC34_MUTE_REG14,
- 0x02,
- (ucontrol->value.integer.value[0] & 0x01) << 1,
- i2c_clt1[2]);
- return 0;
- }
- static int es7210_adc12_mute_get(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- u8 val;
- es7210_read(ES7210_ADC34_MUTE_REG14, &val, i2c_clt1[2]);
- ucontrol->value.integer.value[0] = (val & 0x02) >> 1;
- return 0;
- }
- static int es7210_adc910_suspend_set(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- u8 val;
- if ((ucontrol->value.integer.value[0] & 0x01) == 1) { //suspend
- es7210_update_bits(0x4b, 0xff, 0xff, i2c_clt1[2]);
- es7210_update_bits(0x01, 0x2a, 0x2a, i2c_clt1[2]);
- } else {
- es7210_update_bits(0x4b, 0xff, 0x00, i2c_clt1[2]);
- es7210_read(0x01, &val, i2c_clt1[2]);
- val &= 0x34;
- es7210_write(0x01, val, i2c_clt1[2]);
- }
- return 0;
- }
- static int es7210_adc910_suspend_get(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- u8 val;
- es7210_read(0x4b, &val, i2c_clt1[2]);
- ucontrol->value.integer.value[0] = val & 0x01;
- return 0;
- }
- static int es7210_adc1112_suspend_set(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- u8 val;
- if ((ucontrol->value.integer.value[0] & 0x01) == 1) { //suspend
- es7210_update_bits(0x4c, 0xff, 0xff, i2c_clt1[2]);
- es7210_update_bits(0x01, 0x34, 0x34, i2c_clt1[2]);
- } else {
- es7210_update_bits(0x4c, 0xff, 0x00, i2c_clt1[2]);
- es7210_read(0x01, &val, i2c_clt1[2]);
- val &= 0x2a;
- es7210_write(0x01, val, i2c_clt1[2]);
- }
- return 0;
- }
- static int es7210_adc1112_suspend_get(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- u8 val;
- es7210_read(0x4c, &val, i2c_clt1[2]);
- ucontrol->value.integer.value[0] = val & 0x01;
- return 0;
- }
- #endif
- #if ES7210_CHANNELS_MAX > 12
- static int es7210_micboost13_setting_set(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- es7210_update_bits(0x43,
- 0x0F,
- ucontrol->value.integer.value[0] & 0x0f, i2c_clt1[3]);
- return 0;
- }
- static int es7210_micboost13_setting_get(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- u8 val;
- es7210_read(0x43, &val, i2c_clt1[3]);
- ucontrol->value.integer.value[0] = val & 0x0f;
- return 0;
- }
- static int es7210_micboost14_setting_set(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- es7210_update_bits(0x44,
- 0x0F,
- ucontrol->value.integer.value[0] & 0x0f, i2c_clt1[3]);
- return 0;
- }
- static int es7210_micboost14_setting_get(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- u8 val;
- es7210_read(0x44, &val, i2c_clt1[3]);
- ucontrol->value.integer.value[0] = val & 0x0f;
- return 0;
- }
- static int es7210_micboost15_setting_set(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- es7210_update_bits(0x45,
- 0x0F,
- ucontrol->value.integer.value[0] & 0x0f, i2c_clt1[3]);
- return 0;
- }
- static int es7210_micboost15_setting_get(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- u8 val;
- es7210_read(0x45, &val, i2c_clt1[3]);
- ucontrol->value.integer.value[0] = val & 0x0f;
- return 0;
- }
- static int es7210_micboost16_setting_set(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- es7210_update_bits(0x46,
- 0x0F,
- ucontrol->value.integer.value[0] & 0x0f, i2c_clt1[3]);
- return 0;
- }
- static int es7210_micboost16_setting_get(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- u8 val;
- es7210_read(0x46, &val, i2c_clt1[3]);
- ucontrol->value.integer.value[0] = val & 0x0f;
- return 0;
- }
- static int es7210_adc13_mute_set(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- es7210_update_bits(ES7210_ADC12_MUTE_REG15, 0x01,
- ucontrol->value.integer.value[0] & 0x01,
- i2c_clt1[3]);
- return 0;
- }
- static int es7210_adc13_mute_get(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- u8 val;
- es7210_read(ES7210_ADC12_MUTE_REG15, &val, i2c_clt1[3]);
- ucontrol->value.integer.value[0] = val & 0x01;
- return 0;
- }
- static int es7210_adc14_mute_set(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- es7210_update_bits(ES7210_ADC12_MUTE_REG15,
- 0x02,
- (ucontrol->value.integer.value[0] & 0x01) << 1,
- i2c_clt1[3]);
- return 0;
- }
- static int es7210_adc14_mute_get(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- u8 val;
- es7210_read(ES7210_ADC12_MUTE_REG15, &val, i2c_clt1[3]);
- ucontrol->value.integer.value[0] = (val & 0x02) >> 1;
- return 0;
- }
- static int es7210_adc15_mute_set(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- es7210_update_bits(ES7210_ADC34_MUTE_REG14,
- 0x01,
- ucontrol->value.integer.value[0] & 0x01,
- i2c_clt1[3]);
- return 0;
- }
- static int es7210_adc15_mute_get(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- u8 val;
- es7210_read(ES7210_ADC34_MUTE_REG14, &val, i2c_clt1[3]);
- ucontrol->value.integer.value[0] = val & 0x01;
- return 0;
- }
- static int es7210_adc16_mute_set(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- es7210_update_bits(ES7210_ADC34_MUTE_REG14,
- 0x02,
- (ucontrol->value.integer.value[0] & 0x01) << 1,
- i2c_clt1[3]);
- return 0;
- }
- static int es7210_adc16_mute_get(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- u8 val;
- es7210_read(ES7210_ADC34_MUTE_REG14, &val, i2c_clt1[3]);
- ucontrol->value.integer.value[0] = (val & 0x02) >> 1;
- return 0;
- }
- static int es7210_adc1314_suspend_set(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- u8 val;
- if ((ucontrol->value.integer.value[0] & 0x01) == 1) { //suspend
- es7210_update_bits(0x4b, 0xff, 0xff, i2c_clt1[3]);
- es7210_update_bits(0x01, 0x2a, 0x2a, i2c_clt1[3]);
- } else {
- es7210_update_bits(0x4b, 0xff, 0x00, i2c_clt1[3]);
- es7210_read(0x01, &val, i2c_clt1[3]);
- val &= 0x34;
- es7210_write(0x01, val, i2c_clt1[3]);
- }
- return 0;
- }
- static int es7210_adc1314_suspend_get(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- u8 val;
- es7210_read(0x4b, &val, i2c_clt1[3]);
- ucontrol->value.integer.value[0] = val & 0x01;
- return 0;
- }
- static int es7210_adc1516_suspend_set(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- u8 val;
- if ((ucontrol->value.integer.value[0] & 0x01) == 1) { //suspend
- es7210_update_bits(0x4c, 0xff, 0xff, i2c_clt1[3]);
- es7210_update_bits(0x01, 0x34, 0x34, i2c_clt1[3]);
- } else {
- es7210_update_bits(0x4c, 0xff, 0x00, i2c_clt1[3]);
- es7210_read(0x01, &val, i2c_clt1[3]);
- val &= 0x2a;
- es7210_write(0x01, val, i2c_clt1[3]);
- }
- return 0;
- }
- static int es7210_adc1516_suspend_get(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- u8 val;
- es7210_read(0x4c, &val, i2c_clt1[3]);
- ucontrol->value.integer.value[0] = val & 0x01;
- return 0;
- }
- #endif
- #if ES7210_CHANNELS_MAX > 0
- static int es7210_direct_gain_1_set(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- es7210_update_bits(0x1e,
- 0xFF,
- ucontrol->value.integer.value[0], i2c_clt1[0]);
- return 0;
- }
- static int es7210_direct_gain_1_get(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- u8 val;
- es7210_read(0x1e, &val, i2c_clt1[0]);
- ucontrol->value.integer.value[0] = val;
- return 0;
- }
- static int es7210_direct_gain_2_set(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- es7210_update_bits(0x1D,
- 0xFF,
- ucontrol->value.integer.value[0], i2c_clt1[0]);
- return 0;
- }
- static int es7210_direct_gain_2_get(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- u8 val;
- es7210_read(0x1D, &val, i2c_clt1[0]);
- ucontrol->value.integer.value[0] = val;
- return 0;
- }
- static int es7210_direct_gain_3_set(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- es7210_update_bits(0x1C,
- 0xFF,
- ucontrol->value.integer.value[0], i2c_clt1[0]);
- return 0;
- }
- static int es7210_direct_gain_3_get(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- u8 val;
- es7210_read(0x1C, &val, i2c_clt1[0]);
- ucontrol->value.integer.value[0] = val;
- return 0;
- }
- static int es7210_direct_gain_4_set(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- es7210_update_bits(0x1B,
- 0xFF,
- ucontrol->value.integer.value[0], i2c_clt1[0]);
- return 0;
- }
- static int es7210_direct_gain_4_get(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- u8 val;
- es7210_read(0x1B, &val, i2c_clt1[0]);
- ucontrol->value.integer.value[0] = val;
- return 0;
- }
- static int es7210_direct_gain_12_sameon_set(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value
- *ucontrol)
- {
- es7210_update_bits(0x1a,
- 0x01,
- ucontrol->value.integer.value[0], i2c_clt1[0]);
- return 0;
- }
- static int es7210_direct_gain_12_sameon_get(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value
- *ucontrol)
- {
- u8 val;
- es7210_read(0x1a, &val, i2c_clt1[0]);
- ucontrol->value.integer.value[0] = val;
- return 0;
- }
- static int es7210_direct_gain_34_sameon_set(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value
- *ucontrol)
- {
- es7210_update_bits(0x1a,
- 0x02,
- ucontrol->value.integer.value[0], i2c_clt1[0]);
- return 0;
- }
- static int es7210_direct_gain_34_sameon_get(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value
- *ucontrol)
- {
- u8 val;
- es7210_read(0x1a, &val, i2c_clt1[0]);
- ucontrol->value.integer.value[0] = val;
- return 0;
- }
- #endif
- #if ES7210_CHANNELS_MAX > 4
- static int es7210_direct_gain_5_set(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- es7210_update_bits(0x1e,
- 0xFF,
- ucontrol->value.integer.value[0], i2c_clt1[1]);
- return 0;
- }
- static int es7210_direct_gain_5_get(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- u8 val;
- es7210_read(0x1e, &val, i2c_clt1[1]);
- ucontrol->value.integer.value[0] = val;
- return 0;
- }
- static int es7210_direct_gain_6_set(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- es7210_update_bits(0x1D,
- 0xFF,
- ucontrol->value.integer.value[0], i2c_clt1[1]);
- return 0;
- }
- static int es7210_direct_gain_6_get(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- u8 val;
- es7210_read(0x1D, &val, i2c_clt1[1]);
- ucontrol->value.integer.value[0] = val;
- return 0;
- }
- static int es7210_direct_gain_7_set(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- es7210_update_bits(0x1C,
- 0xFF,
- ucontrol->value.integer.value[0], i2c_clt1[1]);
- return 0;
- }
- static int es7210_direct_gain_7_get(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- u8 val;
- es7210_read(0x1C, &val, i2c_clt1[1]);
- ucontrol->value.integer.value[0] = val;
- return 0;
- }
- static int es7210_direct_gain_8_set(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- es7210_update_bits(0x1B,
- 0xFF,
- ucontrol->value.integer.value[0], i2c_clt1[1]);
- return 0;
- }
- static int es7210_direct_gain_8_get(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- u8 val;
- es7210_read(0x1B, &val, i2c_clt1[1]);
- ucontrol->value.integer.value[0] = val;
- return 0;
- }
- static int es7210_direct_gain_56_sameon_set(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value
- *ucontrol)
- {
- es7210_update_bits(0x1a, 0
- x01, ucontrol->value.integer.value[0], i2c_clt1[1]);
- return 0;
- }
- static int es7210_direct_gain_56_sameon_get(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value
- *ucontrol)
- {
- u8 val;
- es7210_read(0x1a, &val, i2c_clt1[1]);
- ucontrol->value.integer.value[0] = val;
- return 0;
- }
- static int es7210_direct_gain_78_sameon_set(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value
- *ucontrol)
- {
- es7210_update_bits(0x1a,
- 0x02,
- ucontrol->value.integer.value[0], i2c_clt1[1]);
- return 0;
- }
- static int es7210_direct_gain_78_sameon_get(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value
- *ucontrol)
- {
- u8 val;
- es7210_read(0x1a, &val, i2c_clt1[1]);
- ucontrol->value.integer.value[0] = val;
- return 0;
- }
- #endif
- #if ES7210_CHANNELS_MAX > 8
- static int es7210_direct_gain_9_set(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- es7210_update_bits(0x1e,
- 0xFF,
- ucontrol->value.integer.value[0], i2c_clt1[2]);
- return 0;
- }
- static int es7210_direct_gain_9_get(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- u8 val;
- es7210_read(0x1e, &val, i2c_clt1[2]);
- ucontrol->value.integer.value[0] = val;
- return 0;
- }
- static int es7210_direct_gain_10_set(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- es7210_update_bits(0x1D,
- 0xFF,
- ucontrol->value.integer.value[0], i2c_clt1[2]);
- return 0;
- }
- static int es7210_direct_gain_10_get(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- u8 val;
- es7210_read(0x1D, &val, i2c_clt1[2]);
- ucontrol->value.integer.value[0] = val;
- return 0;
- }
- static int es7210_direct_gain_11_set(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- es7210_update_bits(0x1C,
- 0xFF,
- ucontrol->value.integer.value[0], i2c_clt1[2]);
- return 0;
- }
- static int es7210_direct_gain_11_get(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- u8 val;
- es7210_read(0x1C, &val, i2c_clt1[2]);
- ucontrol->value.integer.value[0] = val;
- return 0;
- }
- static int es7210_direct_gain_12_set(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- es7210_update_bits(0x1B,
- 0xFF,
- ucontrol->value.integer.value[0], i2c_clt1[2]);
- return 0;
- }
- static int es7210_direct_gain_12_get(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- u8 val;
- es7210_read(0x1B, &val, i2c_clt1[2]);
- ucontrol->value.integer.value[0] = val;
- return 0;
- }
- static int es7210_direct_gain_9_10_sameon_set(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value
- *ucontrol)
- {
- es7210_update_bits(0x1a,
- 0x01,
- ucontrol->value.integer.value[0], i2c_clt1[2]);
- return 0;
- }
- static int es7210_direct_gain_9_10_sameon_get(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value
- *ucontrol)
- {
- u8 val;
- es7210_read(0x1a, &val, i2c_clt1[2]);
- ucontrol->value.integer.value[0] = val;
- return 0;
- }
- static int es7210_direct_gain_11_12_sameon_set(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value
- *ucontrol)
- {
- es7210_update_bits(0x1a,
- 0x02,
- ucontrol->value.integer.value[0], i2c_clt1[2]);
- return 0;
- }
- static int es7210_direct_gain_11_12_sameon_get(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value
- *ucontrol)
- {
- u8 val;
- es7210_read(0x1a, &val, i2c_clt1[2]);
- ucontrol->value.integer.value[0] = val;
- return 0;
- }
- #endif
- #if ES7210_CHANNELS_MAX > 12
- static int es7210_direct_gain_13_set(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- es7210_update_bits(0x1e,
- 0xFF,
- ucontrol->value.integer.value[0], i2c_clt1[3]);
- return 0;
- }
- static int es7210_direct_gain_13_get(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- u8 val;
- es7210_read(0x1e, &val, i2c_clt1[3]);
- ucontrol->value.integer.value[0] = val;
- return 0;
- }
- static int es7210_direct_gain_14_set(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- es7210_update_bits(0x1D,
- 0xFF,
- ucontrol->value.integer.value[0], i2c_clt1[3]);
- return 0;
- }
- static int es7210_direct_gain_14_get(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- u8 val;
- es7210_read(0x1D, &val, i2c_clt1[3]);
- ucontrol->value.integer.value[0] = val;
- return 0;
- }
- static int es7210_direct_gain_15_set(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- es7210_update_bits(0x1C,
- 0xFF,
- ucontrol->value.integer.value[0], i2c_clt1[3]);
- return 0;
- }
- static int es7210_direct_gain_15_get(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- u8 val;
- es7210_read(0x1C, &val, i2c_clt1[3]);
- ucontrol->value.integer.value[0] = val;
- return 0;
- }
- static int es7210_direct_gain_16_set(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- es7210_update_bits(0x1B,
- 0xFF,
- ucontrol->value.integer.value[0], i2c_clt1[3]);
- return 0;
- }
- static int es7210_direct_gain_16_get(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value *ucontrol)
- {
- u8 val;
- es7210_read(0x1B, &val, i2c_clt1[3]);
- ucontrol->value.integer.value[0] = val;
- return 0;
- }
- static int es7210_direct_gain_13_14_sameon_set(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value
- *ucontrol)
- {
- es7210_update_bits(0x1a,
- 0x01,
- ucontrol->value.integer.value[0], i2c_clt1[3]);
- return 0;
- }
- static int es7210_direct_gain_13_14_sameon_get(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value
- *ucontrol)
- {
- u8 val;
- es7210_read(0x1a, &val, i2c_clt1[3]);
- ucontrol->value.integer.value[0] = val;
- return 0;
- }
- static int es7210_direct_gain_15_16_sameon_set(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value
- *ucontrol)
- {
- es7210_update_bits(0x1a,
- 0x02,
- ucontrol->value.integer.value[0], i2c_clt1[3]);
- return 0;
- }
- static int es7210_direct_gain_15_16_sameon_get(struct snd_kcontrol *kcontrol,
- struct snd_ctl_elem_value
- *ucontrol)
- {
- u8 val;
- es7210_read(0x1a, &val, i2c_clt1[3]);
- ucontrol->value.integer.value[0] = val;
- return 0;
- }
- #endif
- static const struct snd_kcontrol_new es7210_snd_controls[] = {
- #if ES7210_CHANNELS_MAX > 0
- SOC_SINGLE_EXT_TLV("PGA1_setting", 0x43, 0, 0x0F, 0,
- es7210_micboost1_setting_get,
- es7210_micboost1_setting_set,
- mic_boost_tlv),
- SOC_SINGLE_EXT_TLV("PGA2_setting", 0x44, 0, 0x0F, 0,
- es7210_micboost2_setting_get,
- es7210_micboost2_setting_set,
- mic_boost_tlv),
- SOC_SINGLE_EXT_TLV("PGA3_setting", 0x45, 0, 0x0F, 0,
- es7210_micboost3_setting_get,
- es7210_micboost3_setting_set,
- mic_boost_tlv),
- SOC_SINGLE_EXT_TLV("PGA4_setting", 0x46, 0, 0x0F, 0,
- es7210_micboost4_setting_get,
- es7210_micboost4_setting_set,
- mic_boost_tlv),
- SOC_SINGLE_EXT("ADC1_MUTE", ES7210_ADC12_MUTE_REG15,
- 0, 1, 0,
- es7210_adc1_mute_get,
- es7210_adc1_mute_set),
- SOC_SINGLE_EXT("ADC2_MUTE", ES7210_ADC12_MUTE_REG15,
- 1, 1, 0,
- es7210_adc2_mute_get,
- es7210_adc2_mute_set),
- SOC_SINGLE_EXT("ADC3_MUTE", ES7210_ADC34_MUTE_REG14,
- 0, 1, 0,
- es7210_adc3_mute_get,
- es7210_adc3_mute_set),
- SOC_SINGLE_EXT("ADC4_MUTE", ES7210_ADC34_MUTE_REG14,
- 1, 1, 0,
- es7210_adc4_mute_get,
- es7210_adc4_mute_set),
- SOC_SINGLE_EXT_TLV("ADC1_DIRECT_GAIN",
- ES7210_ALC1_MAX_GAIN_REG1E,
- 0, 0xff, 0,
- es7210_direct_gain_1_get,
- es7210_direct_gain_1_set,
- direct_gain_tlv),
- SOC_SINGLE_EXT_TLV("ADC2_DIRECT_GAIN",
- ES7210_ALC2_MAX_GAIN_REG1D,
- 0, 0xff, 0,
- es7210_direct_gain_2_get,
- es7210_direct_gain_2_set,
- direct_gain_tlv),
- SOC_SINGLE_EXT_TLV("ADC3_DIRECT_GAIN",
- ES7210_ALC3_MAX_GAIN_REG1C,
- 0, 0xff, 0,
- es7210_direct_gain_3_get,
- es7210_direct_gain_3_set,
- direct_gain_tlv),
- SOC_SINGLE_EXT_TLV("ADC4_DIRECT_GAIN",
- ES7210_ALC4_MAX_GAIN_REG1B,
- 0, 0xff, 0,
- es7210_direct_gain_4_get,
- es7210_direct_gain_4_set,
- direct_gain_tlv),
- SOC_SINGLE_EXT("DIRECT_1_2_GAIN_SAME_ON",
- ES7210_ALC_COM_CFG2_REG1A,
- 0, 1, 0,
- es7210_direct_gain_12_sameon_get,
- es7210_direct_gain_12_sameon_set),
- SOC_SINGLE_EXT("DIRECT_3_4_GAIN_SAME_ON",
- ES7210_ALC_COM_CFG2_REG1A, 1, 1, 0,
- es7210_direct_gain_34_sameon_get,
- es7210_direct_gain_34_sameon_set),
- SOC_SINGLE_EXT("ADC12_SUSPEND",
- 0x4b, 0, 1, 0,
- es7210_adc12_suspend_get,
- es7210_adc12_suspend_set),
- SOC_SINGLE_EXT("ADC34_SUSPEND",
- 0x4c, 0, 1, 0,
- es7210_adc34_suspend_get,
- es7210_adc34_suspend_set),
- #endif
- #if ES7210_CHANNELS_MAX > 4
- SOC_SINGLE_EXT_TLV("PGA5_setting", 0x43, 0, 0x0F, 0,
- es7210_micboost5_setting_get,
- es7210_micboost5_setting_set,
- mic_boost_tlv),
- SOC_SINGLE_EXT_TLV("PGA6_setting", 0x44, 0, 0x0F, 0,
- es7210_micboost6_setting_get,
- es7210_micboost6_setting_set,
- mic_boost_tlv),
- SOC_SINGLE_EXT_TLV("PGA7_setting", 0x45, 0, 0x0F, 0,
- es7210_micboost7_setting_get,
- es7210_micboost7_setting_set,
- mic_boost_tlv),
- SOC_SINGLE_EXT_TLV("PGA8_setting", 0x46, 0, 0x0F, 0,
- es7210_micboost8_setting_get,
- es7210_micboost8_setting_set,
- mic_boost_tlv),
- SOC_SINGLE_EXT("ADC5_MUTE", ES7210_ADC12_MUTE_REG15,
- 0, 1, 0,
- es7210_adc5_mute_get,
- es7210_adc5_mute_set),
- SOC_SINGLE_EXT("ADC6_MUTE", ES7210_ADC12_MUTE_REG15,
- 1, 1, 0,
- es7210_adc6_mute_get,
- es7210_adc6_mute_set),
- SOC_SINGLE_EXT("ADC7_MUTE", ES7210_ADC34_MUTE_REG14,
- 0, 1, 0,
- es7210_adc7_mute_get,
- es7210_adc7_mute_set),
- SOC_SINGLE_EXT("ADC8_MUTE", ES7210_ADC34_MUTE_REG14,
- 1, 1, 0,
- es7210_adc8_mute_get,
- es7210_adc8_mute_set),
- SOC_SINGLE_EXT_TLV("ADC5_DIRECT_GAIN",
- ES7210_ALC1_MAX_GAIN_REG1E,
- 0, 0xff, 0,
- es7210_direct_gain_5_get,
- es7210_direct_gain_5_set,
- direct_gain_tlv),
- SOC_SINGLE_EXT_TLV("ADC6_DIRECT_GAIN",
- ES7210_ALC2_MAX_GAIN_REG1D,
- 0, 0xff, 0,
- es7210_direct_gain_6_get,
- es7210_direct_gain_6_set,
- direct_gain_tlv),
- SOC_SINGLE_EXT_TLV("ADC7_DIRECT_GAIN",
- ES7210_ALC3_MAX_GAIN_REG1C,
- 0, 0xff, 0,
- es7210_direct_gain_7_get,
- es7210_direct_gain_7_set,
- direct_gain_tlv),
- SOC_SINGLE_EXT_TLV("ADC8_DIRECT_GAIN",
- ES7210_ALC4_MAX_GAIN_REG1B,
- 0, 0xff, 0,
- es7210_direct_gain_8_get,
- es7210_direct_gain_8_set,
- direct_gain_tlv),
- SOC_SINGLE_EXT("DIRECT_5_6_GAIN_SAME_ON",
- ES7210_ALC_COM_CFG2_REG1A,
- 0, 1, 0,
- es7210_direct_gain_56_sameon_get,
- es7210_direct_gain_56_sameon_set),
- SOC_SINGLE_EXT("DIRECT_7_8_GAIN_SAME_ON",
- ES7210_ALC_COM_CFG2_REG1A,
- 1, 1, 0,
- es7210_direct_gain_78_sameon_get,
- es7210_direct_gain_78_sameon_set),
- SOC_SINGLE_EXT("ADC56_SUSPEND",
- 0x4b, 0, 1, 0,
- es7210_adc56_suspend_get,
- es7210_adc56_suspend_set),
- SOC_SINGLE_EXT("ADC78_SUSPEND",
- 0x4c, 0, 1, 0,
- es7210_adc78_suspend_get,
- es7210_adc78_suspend_set),
- #endif
- #if ES7210_CHANNELS_MAX > 8
- SOC_SINGLE_EXT_TLV("PGA9_setting", 0x43, 0, 0x0F, 0,
- es7210_micboost9_setting_get,
- es7210_micboost9_setting_set,
- mic_boost_tlv),
- SOC_SINGLE_EXT_TLV("PGA10_setting", 0x44, 0, 0x0F, 0,
- es7210_micboost10_setting_get,
- es7210_micboost10_setting_set,
- mic_boost_tlv),
- SOC_SINGLE_EXT_TLV("PGA11_setting", 0x45, 0, 0x0F, 0,
- es7210_micboost11_setting_get,
- es7210_micboost11_setting_set,
- mic_boost_tlv),
- SOC_SINGLE_EXT_TLV("PGA12_setting", 0x46, 0, 0x0F, 0,
- es7210_micboost12_setting_get,
- es7210_micboost12_setting_set,
- mic_boost_tlv),
- SOC_SINGLE_EXT("ADC9_MUTE", ES7210_ADC12_MUTE_REG15,
- 0, 1, 0,
- es7210_adc9_mute_get,
- es7210_adc9_mute_set),
- SOC_SINGLE_EXT("ADC10_MUTE", ES7210_ADC12_MUTE_REG15,
- 1, 1, 0,
- es7210_adc10_mute_get,
- es7210_adc10_mute_set),
- SOC_SINGLE_EXT("ADC11_MUTE", ES7210_ADC34_MUTE_REG14,
- 0, 1, 0,
- es7210_adc11_mute_get,
- es7210_adc11_mute_set),
- SOC_SINGLE_EXT("ADC12_MUTE", ES7210_ADC34_MUTE_REG14,
- 1, 1, 0,
- es7210_adc12_mute_get,
- es7210_adc12_mute_set),
- SOC_SINGLE_EXT_TLV("ADC9_DIRECT_GAIN",
- ES7210_ALC1_MAX_GAIN_REG1E,
- 0, 0xff, 0,
- es7210_direct_gain_9_get,
- es7210_direct_gain_9_set,
- direct_gain_tlv),
- SOC_SINGLE_EXT_TLV("ADC10_DIRECT_GAIN",
- ES7210_ALC2_MAX_GAIN_REG1D,
- 0, 0xff, 0,
- es7210_direct_gain_10_get,
- es7210_direct_gain_10_set,
- direct_gain_tlv),
- SOC_SINGLE_EXT_TLV("ADC11_DIRECT_GAIN",
- ES7210_ALC3_MAX_GAIN_REG1C,
- 0, 0xff, 0,
- es7210_direct_gain_11_get,
- es7210_direct_gain_11_set,
- direct_gain_tlv),
- SOC_SINGLE_EXT_TLV("ADC12_DIRECT_GAIN",
- ES7210_ALC4_MAX_GAIN_REG1B,
- 0, 0xff, 0,
- es7210_direct_gain_12_get,
- es7210_direct_gain_12_set,
- direct_gain_tlv),
- SOC_SINGLE_EXT("DIRECT_9_10_GAIN_SAME_ON",
- ES7210_ALC_COM_CFG2_REG1A,
- 0, 1, 0,
- es7210_direct_gain_9_10_sameon_get,
- es7210_direct_gain_9_10_sameon_set),
- SOC_SINGLE_EXT("DIRECT_11_12_GAIN_SAME_ON",
- ES7210_ALC_COM_CFG2_REG1A,
- 1, 1, 0,
- es7210_direct_gain_11_12_sameon_get,
- es7210_direct_gain_11_12_sameon_set),
- SOC_SINGLE_EXT("ADC910_SUSPEND",
- 0x4b, 0, 1, 0,
- es7210_adc910_suspend_get,
- es7210_adc910_suspend_set),
- SOC_SINGLE_EXT("ADC1112_SUSPEND",
- 0x4c, 0, 1, 0,
- es7210_adc1112_suspend_get,
- es7210_adc1112_suspend_set),
- #endif
- #if ES7210_CHANNELS_MAX > 12
- SOC_SINGLE_EXT_TLV("PGA13_setting", 0x43, 0, 0x0F, 0,
- es7210_micboost13_setting_get,
- es7210_micboost13_setting_set,
- mic_boost_tlv),
- SOC_SINGLE_EXT_TLV("PGA14_setting", 0x44, 0, 0x0F, 0,
- es7210_micboost14_setting_get,
- es7210_micboost14_setting_set,
- mic_boost_tlv),
- SOC_SINGLE_EXT_TLV("PGA15_setting", 0x45, 0, 0x0F, 0,
- es7210_micboost15_setting_get,
- es7210_micboost15_setting_set,
- mic_boost_tlv),
- SOC_SINGLE_EXT_TLV("PGA16_setting", 0x46, 0, 0x0F, 0,
- es7210_micboost16_setting_get,
- es7210_micboost16_setting_set,
- mic_boost_tlv),
- SOC_SINGLE_EXT("ADC13_MUTE", ES7210_ADC12_MUTE_REG15,
- 0, 1, 0,
- es7210_adc13_mute_get,
- es7210_adc13_mute_set),
- SOC_SINGLE_EXT("ADC14_MUTE", ES7210_ADC12_MUTE_REG15,
- 1, 1, 0,
- es7210_adc14_mute_get,
- es7210_adc14_mute_set),
- SOC_SINGLE_EXT("ADC15_MUTE", ES7210_ADC34_MUTE_REG14,
- 0, 1, 0,
- es7210_adc15_mute_get,
- es7210_adc15_mute_set),
- SOC_SINGLE_EXT("ADC16_MUTE", ES7210_ADC34_MUTE_REG14,
- 1, 1, 0,
- es7210_adc16_mute_get,
- es7210_adc16_mute_set),
- SOC_SINGLE_EXT_TLV("ADC13_DIRECT_GAIN",
- ES7210_ALC1_MAX_GAIN_REG1E,
- 0, 0xff, 0,
- es7210_direct_gain_13_get,
- es7210_direct_gain_13_set,
- direct_gain_tlv),
- SOC_SINGLE_EXT_TLV("ADC14_DIRECT_GAIN",
- ES7210_ALC2_MAX_GAIN_REG1D,
- 0, 0xff, 0,
- es7210_direct_gain_14_get,
- es7210_direct_gain_14_set,
- direct_gain_tlv),
- SOC_SINGLE_EXT_TLV("ADC15_DIRECT_GAIN",
- ES7210_ALC3_MAX_GAIN_REG1C,
- 0, 0xff, 0,
- es7210_direct_gain_15_get,
- es7210_direct_gain_15_set,
- direct_gain_tlv),
- SOC_SINGLE_EXT_TLV("ADC16_DIRECT_GAIN",
- ES7210_ALC4_MAX_GAIN_REG1B,
- 0, 0xff, 0,
- es7210_direct_gain_16_get,
- es7210_direct_gain_16_set,
- direct_gain_tlv),
- SOC_SINGLE_EXT("DIRECT_13_14_GAIN_SAME_ON",
- ES7210_ALC_COM_CFG2_REG1A,
- 0, 1, 0,
- es7210_direct_gain_13_14_sameon_get,
- es7210_direct_gain_13_14_sameon_set),
- SOC_SINGLE_EXT("DIRECT_15_16_GAIN_SAME_ON",
- ES7210_ALC_COM_CFG2_REG1A,
- 1, 1, 0,
- es7210_direct_gain_15_16_sameon_get,
- es7210_direct_gain_15_16_sameon_set),
- SOC_SINGLE_EXT("ADC1314_SUSPEND",
- 0x4b, 0, 1, 0,
- es7210_adc1314_suspend_get,
- es7210_adc1314_suspend_set),
- SOC_SINGLE_EXT("ADC1516_SUSPEND",
- 0x4c, 0, 1, 0,
- es7210_adc1516_suspend_get,
- es7210_adc1516_suspend_set),
- #endif
- };
|