TAS5764L support
Signed-off-by: Alexander Egorenkov <egorenar-dev@posteo.net>
This commit is contained in:
parent
0f149f3758
commit
25fa98308e
4 changed files with 860 additions and 177 deletions
|
@ -100,6 +100,13 @@ struct cs_spec {
|
||||||
struct unsol_item unsol_items_prealloc[10];
|
struct unsol_item unsol_items_prealloc[10];
|
||||||
int unsol_items_prealloc_used[10];
|
int unsol_items_prealloc_used[10];
|
||||||
|
|
||||||
|
// add in specific nids for the intmike and linein as they seem to swap
|
||||||
|
// between macbook pros (14,3) and imacs (18,3)
|
||||||
|
int intmike_nid;
|
||||||
|
int linein_nid;
|
||||||
|
int intmike_adc_nid;
|
||||||
|
int linein_amp_nid;
|
||||||
|
|
||||||
// new item to deal with jack presence as Apple seems to have barfed
|
// new item to deal with jack presence as Apple seems to have barfed
|
||||||
// the HDA spec by using a separate headphone chip
|
// the HDA spec by using a separate headphone chip
|
||||||
int jack_present;
|
int jack_present;
|
||||||
|
@ -1437,7 +1444,7 @@ static int cs_8409_capture_pcm_prepare(struct hda_pcm_stream *hinfo,
|
||||||
unsigned int format,
|
unsigned int format,
|
||||||
struct snd_pcm_substream *substream)
|
struct snd_pcm_substream *substream)
|
||||||
{
|
{
|
||||||
struct hda_gen_spec *spec = codec->spec;
|
struct cs_spec *spec = codec->spec;
|
||||||
|
|
||||||
codec_dbg(codec, "cs_8409_capture_pcm_prepare\n");
|
codec_dbg(codec, "cs_8409_capture_pcm_prepare\n");
|
||||||
|
|
||||||
|
@ -1457,7 +1464,7 @@ static int cs_8409_capture_pcm_prepare(struct hda_pcm_stream *hinfo,
|
||||||
// - so as the format here is same (or at least should be!!) as that setup there is no format difference to that
|
// - so as the format here is same (or at least should be!!) as that setup there is no format difference to that
|
||||||
// cached and snd_hda_coded_setup_stream does nothing
|
// cached and snd_hda_coded_setup_stream does nothing
|
||||||
|
|
||||||
if (hinfo->nid == 0x22)
|
if (hinfo->nid == spec->intmike_adc_nid)
|
||||||
{
|
{
|
||||||
|
|
||||||
// so this is getting stranger and stranger
|
// so this is getting stranger and stranger
|
||||||
|
@ -1492,8 +1499,8 @@ static int cs_8409_capture_pcm_prepare(struct hda_pcm_stream *hinfo,
|
||||||
// HDA_GEN_PCM_ACT_PREPARE);
|
// HDA_GEN_PCM_ACT_PREPARE);
|
||||||
// but its a trivial function - at least for the moment!!
|
// but its a trivial function - at least for the moment!!
|
||||||
// note this hook if defined also needs to switch between the 2 versions of input!!
|
// note this hook if defined also needs to switch between the 2 versions of input!!
|
||||||
if (spec->pcm_capture_hook)
|
if (spec->gen.pcm_capture_hook)
|
||||||
spec->pcm_capture_hook(hinfo, codec, substream, HDA_GEN_PCM_ACT_PREPARE);
|
spec->gen.pcm_capture_hook(hinfo, codec, substream, HDA_GEN_PCM_ACT_PREPARE);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -1646,9 +1653,9 @@ static int cs_8409_init(struct hda_codec *codec)
|
||||||
// (I still dont really understand the linux generic coding here)
|
// (I still dont really understand the linux generic coding here)
|
||||||
// with capture devices we seem to get 2 pcm streams (0 and 1)
|
// with capture devices we seem to get 2 pcm streams (0 and 1)
|
||||||
// each pcm stream has an output stream (0) and an input stream (1)
|
// each pcm stream has an output stream (0) and an input stream (1)
|
||||||
// the 1st pcm stream (0) is assigned nid 0x02 for output and nid 0x22 for input (internal mike)
|
// the 1st pcm stream (0) is assigned nid 0x02 for output and nid 0x22 (macbook pro) for input (internal mike)
|
||||||
// the 2nd pcm stream (1) has a dummy output stream and nid 0x1a for input (headset mike via cs42l83)
|
// the 2nd pcm stream (1) has a dummy output stream and nid 0x1a for input (headset mike via cs42l83)
|
||||||
// (NOTE this means the line input stream (0x45->0x32) is not assigned currently ie not useable)
|
// (NOTE this means the line input stream (0x45->0x23) (macbook pro) is not assigned currently ie not useable)
|
||||||
|
|
||||||
list_for_each_entry(info, &codec->pcm_list_head, list) {
|
list_for_each_entry(info, &codec->pcm_list_head, list) {
|
||||||
int stream;
|
int stream;
|
||||||
|
@ -1676,10 +1683,11 @@ static int cs_8409_init(struct hda_codec *codec)
|
||||||
}
|
}
|
||||||
else if (stream == SNDRV_PCM_STREAM_CAPTURE)
|
else if (stream == SNDRV_PCM_STREAM_CAPTURE)
|
||||||
{
|
{
|
||||||
if (hinfo->nid == 0x22)
|
//if (hinfo->nid == 0x22)
|
||||||
|
if (hinfo->nid == spec->intmike_adc_nid)
|
||||||
{
|
{
|
||||||
// this is the internal mike
|
// this is the internal mike
|
||||||
// this is a bit weird - the output nodes are id'ed by output input pin nid
|
// this is a bit weird - the output nodes are id'ed by input pin nid
|
||||||
// but the input nodes are done by the input (adc) nid - not the input pin nid
|
// but the input nodes are done by the input (adc) nid - not the input pin nid
|
||||||
codec_dbg(codec, "cs_8409_init info capture stream %d pointer %p\n",stream,hinfo);
|
codec_dbg(codec, "cs_8409_init info capture stream %d pointer %p\n",stream,hinfo);
|
||||||
// so now we could force the rates and formats to the single one Apple defines ie 44.1 kHz and S24_LE
|
// so now we could force the rates and formats to the single one Apple defines ie 44.1 kHz and S24_LE
|
||||||
|
@ -1697,7 +1705,7 @@ static int cs_8409_init(struct hda_codec *codec)
|
||||||
else if (hinfo->nid == 0x1a)
|
else if (hinfo->nid == 0x1a)
|
||||||
{
|
{
|
||||||
// this is the external mike ie headset mike
|
// this is the external mike ie headset mike
|
||||||
// this is a bit weird - the output nodes are id'ed by output input pin nid
|
// this is a bit weird - the output nodes are id'ed by input pin nid
|
||||||
// but the input nodes are done by the input (adc) nid - not the input pin nid
|
// but the input nodes are done by the input (adc) nid - not the input pin nid
|
||||||
codec_dbg(codec, "cs_8409_init info capture stream %d pointer %p\n",stream,hinfo);
|
codec_dbg(codec, "cs_8409_init info capture stream %d pointer %p\n",stream,hinfo);
|
||||||
// so now we force the rates and formats to the single one Apple defines ie 44.1 kHz and S24_LE
|
// so now we force the rates and formats to the single one Apple defines ie 44.1 kHz and S24_LE
|
||||||
|
@ -1911,7 +1919,7 @@ static int cs_8409_parse_auto_config(struct hda_codec *codec)
|
||||||
// because it appears the auto config assumes the inputs are connected to an ADC (or audio input converter widget)
|
// because it appears the auto config assumes the inputs are connected to an ADC (or audio input converter widget)
|
||||||
// (NOTE - although these are labelled ADC nodes in the code they may not have an actual analog to digital
|
// (NOTE - although these are labelled ADC nodes in the code they may not have an actual analog to digital
|
||||||
// converter - may just be a digital sample formatter eg S/PDIF input - for the 8409 the internal mike
|
// converter - may just be a digital sample formatter eg S/PDIF input - for the 8409 the internal mike
|
||||||
// seems to be a standard ADC node (0x22) but the headphone input node (0x1a) is a digital input as digitization
|
// seems to be a standard ADC node (eg 0x22 for macbook pro) but the headphone input node (0x1a) is a digital input as digitization
|
||||||
// has already occurred in the cs42l83)
|
// has already occurred in the cs42l83)
|
||||||
// now recoding the input setup in separate function
|
// now recoding the input setup in separate function
|
||||||
//spec->gen.num_adc_nids = 0;
|
//spec->gen.num_adc_nids = 0;
|
||||||
|
@ -2437,6 +2445,23 @@ static int patch_cs8409(struct hda_codec *codec)
|
||||||
spec->headset_enable = 0;
|
spec->headset_enable = 0;
|
||||||
|
|
||||||
|
|
||||||
|
// setup the intmike and linein nids
|
||||||
|
if (codec->core.subsystem_id == 0x106b1000)
|
||||||
|
{
|
||||||
|
spec->intmike_nid = 0x45;
|
||||||
|
spec->intmike_adc_nid = 0x23;
|
||||||
|
spec->linein_nid = 0x44;
|
||||||
|
spec->linein_amp_nid = 0x22;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
spec->intmike_nid = 0x44;
|
||||||
|
spec->intmike_adc_nid = 0x22;
|
||||||
|
spec->linein_nid = 0x45;
|
||||||
|
spec->linein_amp_nid = 0x23;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// so it appears we dont get interrupts in the auto config stage
|
// so it appears we dont get interrupts in the auto config stage
|
||||||
|
|
||||||
// we need to figure out how to setup the jack detect callback
|
// we need to figure out how to setup the jack detect callback
|
||||||
|
@ -2527,7 +2552,7 @@ static int patch_cs8409(struct hda_codec *codec)
|
||||||
}
|
}
|
||||||
|
|
||||||
myprintk("snd_hda_intel: auto config multiout is dig_out_nid 0x%02x\n", spec->gen.multiout.dig_out_nid);
|
myprintk("snd_hda_intel: auto config multiout is dig_out_nid 0x%02x\n", spec->gen.multiout.dig_out_nid);
|
||||||
myprintk("snd_hda_intel: auto config multiout is slv_dig_out %p\n", spec->gen.multiout.slave_dig_outs);
|
//myprintk("snd_hda_intel: auto config multiout is slv_dig_out %p\n", spec->gen.multiout.slave_dig_outs);
|
||||||
|
|
||||||
|
|
||||||
// dump the rates/format of the afg node
|
// dump the rates/format of the afg node
|
||||||
|
|
|
@ -1634,17 +1634,18 @@ static void setup_jack_pin_config(struct hda_codec *codec)
|
||||||
{
|
{
|
||||||
|
|
||||||
//int retval;
|
//int retval;
|
||||||
|
struct cs_spec *spec = codec->spec;
|
||||||
|
|
||||||
// this is likely some call of setPinConfigDefault
|
// this is likely some call of setPinConfigDefault
|
||||||
// 0x45 -> 0x23 is the line in path - so why does it say its a mike??
|
// 0x45 -> 0x23 (macbook pro) is the line in path - so why does it say its a mike??
|
||||||
|
|
||||||
//snd_hda_codec_write(codec, codec->core.afg, 0, AC_VERB_SET_POWER_STATE, 0x00000000); // 0x00170500
|
//snd_hda_codec_write(codec, codec->core.afg, 0, AC_VERB_SET_POWER_STATE, 0x00000000); // 0x00170500
|
||||||
//hda_set_node_power_state(codec, codec->core.afg, AC_PWRST_D0);
|
//hda_set_node_power_state(codec, codec->core.afg, AC_PWRST_D0);
|
||||||
|
|
||||||
snd_hda_codec_write(codec, 0x45, 0, AC_VERB_SET_CONFIG_DEFAULT_BYTES_0, 0x00000001); // 0x04571c01
|
snd_hda_codec_write(codec, spec->linein_nid, 0, AC_VERB_SET_CONFIG_DEFAULT_BYTES_0, 0x00000001); // 0x04571c01
|
||||||
snd_hda_codec_write(codec, 0x45, 0, AC_VERB_SET_CONFIG_DEFAULT_BYTES_1, 0x00000001); // 0x04571d01
|
snd_hda_codec_write(codec, spec->linein_nid, 0, AC_VERB_SET_CONFIG_DEFAULT_BYTES_1, 0x00000001); // 0x04571d01
|
||||||
snd_hda_codec_write(codec, 0x45, 0, AC_VERB_SET_CONFIG_DEFAULT_BYTES_2, 0x000000a0); // 0x04571ea0
|
snd_hda_codec_write(codec, spec->linein_nid, 0, AC_VERB_SET_CONFIG_DEFAULT_BYTES_2, 0x000000a0); // 0x04571ea0
|
||||||
snd_hda_codec_write(codec, 0x45, 0, AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0x00000090); // 0x04571f90
|
snd_hda_codec_write(codec, spec->linein_nid, 0, AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0x00000090); // 0x04571f90
|
||||||
// snd_hda: pin config 0x90a00101 port conn 2 location 0x10 loc ext 1 loc geom 0 default device 10 conn type 0 color 0 misc 1 def assoc 0 seq 1
|
// snd_hda: pin config 0x90a00101 port conn 2 location 0x10 loc ext 1 loc geom 0 default device 10 conn type 0 color 0 misc 1 def assoc 0 seq 1
|
||||||
// snd_hda: pin config 0x90a00101 port conn Fixed loc ext Int loc geom N/A default device Mic In conn type Unknown color Unknown misc Jack Detect Override def assoc 0 seq 1
|
// snd_hda: pin config 0x90a00101 port conn Fixed loc ext Int loc geom N/A default device Mic In conn type Unknown color Unknown misc Jack Detect Override def assoc 0 seq 1
|
||||||
|
|
||||||
|
@ -2227,6 +2228,148 @@ static void setup_amps_reset_i2c_ssm3(struct hda_codec *codec)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void setup_gpio_set_10(struct hda_codec *codec);
|
||||||
|
|
||||||
|
static void setup_amps_reset_i2c_tas576(struct hda_codec *codec)
|
||||||
|
{
|
||||||
|
// the Texas TAS5764 is undocumented - the nearest seems to be the TAS5760md
|
||||||
|
// which has some similarities but some discrepancies
|
||||||
|
// for the moment using the TAS5760md registers where they seem to be similar
|
||||||
|
// based on info that writing to coef index 0x59 seems to be the i2c address hence the amps i2c address following are
|
||||||
|
// 0xd8, 0xda, 0xdc, 0xde
|
||||||
|
|
||||||
|
setup_gpio_set_10(codec);
|
||||||
|
|
||||||
|
// snd_hda i2cWrite i2c address 0xd8 i2c reg 0x01fc i2c data 0x00fc reg anal: Power Control : Not Sleep, Spkr Amp Shutdown
|
||||||
|
// snd_hda i2cWrite i2c address 0xd8 i2c reg 0x0204 i2c data 0x0004 reg anal: Digital Control : I2S format
|
||||||
|
// snd_hda i2cWrite i2c address 0xd8 i2c reg 0x0380 i2c data 0x0080 reg anal: Volume Control : Fade
|
||||||
|
// snd_hda i2cWrite i2c address 0xd8 i2c reg 0x04cf i2c data 0x00cf reg anal: Left Chan Vol Control : 0dB
|
||||||
|
// snd_hda i2cWrite i2c address 0xd8 i2c reg 0x0651 i2c data 0x0051 reg anal: Analog Control : PWM Rate x16
|
||||||
|
// snd_hda i2cWrite i2c address 0xd8 i2c reg 0x0800 i2c data 0x0000 reg anal: Fault Config & Error
|
||||||
|
// snd_hda i2cWrite i2c address 0xd8 i2c reg 0x10ff i2c data 0x00ff reg anal: Digital Clipper
|
||||||
|
// snd_hda i2cWrite i2c address 0xd8 i2c reg 0x11fc i2c data 0x00fc reg anal: Undocumented
|
||||||
|
// snd_hda i2cWrite i2c address 0xd8 i2c reg 0x1300 i2c data 0x0000 reg anal: Undocumented
|
||||||
|
// snd_hda i2cWrite i2c address 0xd8 i2c reg 0x1402 i2c data 0x0002 reg anal: Undocumented
|
||||||
|
|
||||||
|
cs_8409_vendor_i2cWrite(codec, 0xd8, 0x0001, 0x00fc, 0); // snd_hda
|
||||||
|
cs_8409_vendor_i2cWrite(codec, 0xd8, 0x0002, 0x0004, 0); // snd_hda
|
||||||
|
cs_8409_vendor_i2cWrite(codec, 0xd8, 0x0003, 0x0080, 0); // snd_hda
|
||||||
|
cs_8409_vendor_i2cWrite(codec, 0xd8, 0x0004, 0x00cf, 0); // snd_hda
|
||||||
|
cs_8409_vendor_i2cWrite(codec, 0xd8, 0x0006, 0x0051, 0); // snd_hda
|
||||||
|
cs_8409_vendor_i2cWrite(codec, 0xd8, 0x0008, 0x0000, 0); // snd_hda
|
||||||
|
cs_8409_vendor_i2cWrite(codec, 0xd8, 0x0010, 0x00ff, 0); // snd_hda
|
||||||
|
cs_8409_vendor_i2cWrite(codec, 0xd8, 0x0011, 0x00fc, 0); // snd_hda
|
||||||
|
cs_8409_vendor_i2cWrite(codec, 0xd8, 0x0013, 0x0000, 0); // snd_hda
|
||||||
|
cs_8409_vendor_i2cWrite(codec, 0xd8, 0x0014, 0x0002, 0); // snd_hda
|
||||||
|
|
||||||
|
setup_gpio_set_10(codec);
|
||||||
|
|
||||||
|
// snd_hda i2cWrite i2c address 0xda i2c reg 0x01fc i2c data 0x00fc reg anal: Power Control : Not Sleep, Spkr Amp Shutdown
|
||||||
|
// snd_hda i2cWrite i2c address 0xda i2c reg 0x0204 i2c data 0x0004 reg anal: Digital Control : I2S format
|
||||||
|
// snd_hda i2cWrite i2c address 0xda i2c reg 0x0380 i2c data 0x0080 reg anal: Volume Control : Fade
|
||||||
|
// snd_hda i2cWrite i2c address 0xda i2c reg 0x04cf i2c data 0x00cf reg anal: Left Chan Vol Control : 0dB
|
||||||
|
// snd_hda i2cWrite i2c address 0xda i2c reg 0x0651 i2c data 0x0051 reg anal: Analog Control : PWM Rate x16
|
||||||
|
// snd_hda i2cWrite i2c address 0xda i2c reg 0x0800 i2c data 0x0000 reg anal: Fault Config & Error
|
||||||
|
// snd_hda i2cWrite i2c address 0xda i2c reg 0x10ff i2c data 0x00ff reg anal: Digital Clipper
|
||||||
|
// snd_hda i2cWrite i2c address 0xda i2c reg 0x11fc i2c data 0x00fc reg anal: Undocumented
|
||||||
|
// snd_hda i2cWrite i2c address 0xda i2c reg 0x1300 i2c data 0x0000 reg anal: Undocumented
|
||||||
|
// snd_hda i2cWrite i2c address 0xda i2c reg 0x1402 i2c data 0x0002 reg anal: Undocumented
|
||||||
|
|
||||||
|
cs_8409_vendor_i2cWrite(codec, 0xda, 0x0001, 0x00fc, 0); // snd_hda
|
||||||
|
cs_8409_vendor_i2cWrite(codec, 0xda, 0x0002, 0x0004, 0); // snd_hda
|
||||||
|
cs_8409_vendor_i2cWrite(codec, 0xda, 0x0003, 0x0080, 0); // snd_hda
|
||||||
|
cs_8409_vendor_i2cWrite(codec, 0xda, 0x0004, 0x00cf, 0); // snd_hda
|
||||||
|
cs_8409_vendor_i2cWrite(codec, 0xda, 0x0006, 0x0051, 0); // snd_hda
|
||||||
|
cs_8409_vendor_i2cWrite(codec, 0xda, 0x0008, 0x0000, 0); // snd_hda
|
||||||
|
cs_8409_vendor_i2cWrite(codec, 0xda, 0x0010, 0x00ff, 0); // snd_hda
|
||||||
|
cs_8409_vendor_i2cWrite(codec, 0xda, 0x0011, 0x00fc, 0); // snd_hda
|
||||||
|
cs_8409_vendor_i2cWrite(codec, 0xda, 0x0013, 0x0000, 0); // snd_hda
|
||||||
|
cs_8409_vendor_i2cWrite(codec, 0xda, 0x0014, 0x0002, 0); // snd_hda
|
||||||
|
|
||||||
|
setup_gpio_set_10(codec);
|
||||||
|
|
||||||
|
// snd_hda i2cWrite i2c address 0xdc i2c reg 0x01fc i2c data 0x00fc reg anal: Power Control : Not Sleep, Spkr Amp Shutdown
|
||||||
|
// snd_hda i2cWrite i2c address 0xdc i2c reg 0x0204 i2c data 0x0004 reg anal: Digital Control : I2S format
|
||||||
|
// snd_hda i2cWrite i2c address 0xdc i2c reg 0x0380 i2c data 0x0080 reg anal: Volume Control : Fade
|
||||||
|
// snd_hda i2cWrite i2c address 0xdc i2c reg 0x04cf i2c data 0x00cf reg anal: Left Chan Vol Control : 0dB
|
||||||
|
// snd_hda i2cWrite i2c address 0xdc i2c reg 0x0651 i2c data 0x0051 reg anal: Analog Control : PWM Rate x16
|
||||||
|
// snd_hda i2cWrite i2c address 0xdc i2c reg 0x0800 i2c data 0x0000 reg anal: Fault Config & Error
|
||||||
|
// snd_hda i2cWrite i2c address 0xdc i2c reg 0x10ff i2c data 0x00ff reg anal: Digital Clipper
|
||||||
|
// snd_hda i2cWrite i2c address 0xdc i2c reg 0x11fc i2c data 0x00fc reg anal: Undocumented
|
||||||
|
// snd_hda i2cWrite i2c address 0xdc i2c reg 0x1300 i2c data 0x0000 reg anal: Undocumented
|
||||||
|
// snd_hda i2cWrite i2c address 0xdc i2c reg 0x1402 i2c data 0x0002 reg anal: Undocumented
|
||||||
|
|
||||||
|
cs_8409_vendor_i2cWrite(codec, 0xdc, 0x0001, 0x00fc, 0); // snd_hda
|
||||||
|
cs_8409_vendor_i2cWrite(codec, 0xdc, 0x0002, 0x0004, 0); // snd_hda
|
||||||
|
cs_8409_vendor_i2cWrite(codec, 0xdc, 0x0003, 0x0080, 0); // snd_hda
|
||||||
|
cs_8409_vendor_i2cWrite(codec, 0xdc, 0x0004, 0x00cf, 0); // snd_hda
|
||||||
|
cs_8409_vendor_i2cWrite(codec, 0xdc, 0x0006, 0x0051, 0); // snd_hda
|
||||||
|
cs_8409_vendor_i2cWrite(codec, 0xdc, 0x0008, 0x0000, 0); // snd_hda
|
||||||
|
cs_8409_vendor_i2cWrite(codec, 0xdc, 0x0010, 0x00ff, 0); // snd_hda
|
||||||
|
cs_8409_vendor_i2cWrite(codec, 0xdc, 0x0011, 0x00fc, 0); // snd_hda
|
||||||
|
cs_8409_vendor_i2cWrite(codec, 0xdc, 0x0013, 0x0000, 0); // snd_hda
|
||||||
|
cs_8409_vendor_i2cWrite(codec, 0xdc, 0x0014, 0x0002, 0); // snd_hda
|
||||||
|
|
||||||
|
setup_gpio_set_10(codec);
|
||||||
|
|
||||||
|
// snd_hda i2cWrite i2c address 0xde i2c reg 0x01fc i2c data 0x00fc reg anal: Power Control : Not Sleep, Spkr Amp Shutdown
|
||||||
|
// snd_hda i2cWrite i2c address 0xde i2c reg 0x0204 i2c data 0x0004 reg anal: Digital Control : I2S format
|
||||||
|
// snd_hda i2cWrite i2c address 0xde i2c reg 0x0380 i2c data 0x0080 reg anal: Volume Control : Fade
|
||||||
|
// snd_hda i2cWrite i2c address 0xde i2c reg 0x04cf i2c data 0x00cf reg anal: Left Chan Vol Control : 0dB
|
||||||
|
// snd_hda i2cWrite i2c address 0xde i2c reg 0x0651 i2c data 0x0051 reg anal: Analog Control : PWM Rate x16
|
||||||
|
// snd_hda i2cWrite i2c address 0xde i2c reg 0x0800 i2c data 0x0000 reg anal: Fault Config & Error
|
||||||
|
// snd_hda i2cWrite i2c address 0xde i2c reg 0x10ff i2c data 0x00ff reg anal: Digital Clipper
|
||||||
|
// snd_hda i2cWrite i2c address 0xde i2c reg 0x11fc i2c data 0x00fc reg anal: Undocumented
|
||||||
|
// snd_hda i2cWrite i2c address 0xde i2c reg 0x1300 i2c data 0x0000 reg anal: Undocumented
|
||||||
|
// snd_hda i2cWrite i2c address 0xde i2c reg 0x1402 i2c data 0x0002 reg anal: Undocumented
|
||||||
|
|
||||||
|
cs_8409_vendor_i2cWrite(codec, 0xde, 0x0001, 0x00fc, 0); // snd_hda
|
||||||
|
cs_8409_vendor_i2cWrite(codec, 0xde, 0x0002, 0x0004, 0); // snd_hda
|
||||||
|
cs_8409_vendor_i2cWrite(codec, 0xde, 0x0003, 0x0080, 0); // snd_hda
|
||||||
|
cs_8409_vendor_i2cWrite(codec, 0xde, 0x0004, 0x00cf, 0); // snd_hda
|
||||||
|
cs_8409_vendor_i2cWrite(codec, 0xde, 0x0006, 0x0051, 0); // snd_hda
|
||||||
|
cs_8409_vendor_i2cWrite(codec, 0xde, 0x0008, 0x0000, 0); // snd_hda
|
||||||
|
cs_8409_vendor_i2cWrite(codec, 0xde, 0x0010, 0x00ff, 0); // snd_hda
|
||||||
|
cs_8409_vendor_i2cWrite(codec, 0xde, 0x0011, 0x00fc, 0); // snd_hda
|
||||||
|
cs_8409_vendor_i2cWrite(codec, 0xde, 0x0013, 0x0000, 0); // snd_hda
|
||||||
|
cs_8409_vendor_i2cWrite(codec, 0xde, 0x0014, 0x0002, 0); // snd_hda
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
static void setup_gpio_set_10(struct hda_codec *codec)
|
||||||
|
{
|
||||||
|
|
||||||
|
// plausibly AppleHDAFunctionGroupExternalControl_GPIO::publicSetExternalControlState(bool)
|
||||||
|
|
||||||
|
// I think this may be associated with the amps
|
||||||
|
// its either applying power to the amps or taking them out of reset
|
||||||
|
// (note that unlike GPIO 2 there doesnt seem to be a clear 10)
|
||||||
|
|
||||||
|
// note that this seems to be following the MAX style setup
|
||||||
|
|
||||||
|
mycodec_info(codec, "command setup_gpio_set_10 start\n");
|
||||||
|
|
||||||
|
//snd_hda_codec_write(codec, codec->core.afg, 0, AC_VERB_SET_POWER_STATE, 0x00000000); // 0x00170500
|
||||||
|
//hda_set_node_power_state(codec, codec->core.afg, AC_PWRST_D0);
|
||||||
|
|
||||||
|
//snd_hda_codec_write(codec, codec->core.afg, 0, AC_VERB_SET_GPIO_DIRECTION, 0x00000012); // 0x00171712
|
||||||
|
// snd_hda: gpio direction 1 0x12 in in in out in in out in
|
||||||
|
//snd_hda_codec_write(codec, codec->core.afg, 0, AC_VERB_SET_GPIO_DATA, 0x00000012); // 0x00171512
|
||||||
|
// snd_hda: gpio data 1 0x12
|
||||||
|
//snd_hda_codec_write(codec, codec->core.afg, 0, AC_VERB_SET_GPIO_MASK, 0x0000001f); // 0x0017161f
|
||||||
|
// snd_hda: gpio enable 1 0x1f
|
||||||
|
|
||||||
|
|
||||||
|
snd_hda_codec_write(codec, codec->core.afg, 0, AC_VERB_SET_GPIO_DIRECTION, 0x00000012); // 0x00171712
|
||||||
|
snd_hda_codec_write(codec, codec->core.afg, 0, AC_VERB_SET_GPIO_DATA, 0x00000012); // 0x00171512
|
||||||
|
snd_hda_codec_write(codec, codec->core.afg, 0, AC_VERB_SET_GPIO_MASK, 0x0000001f); // 0x0017161f
|
||||||
|
|
||||||
|
//snd_hda_codec_write(codec, codec->core.afg, 0, AC_VERB_SET_POWER_STATE, 0x00000003); // 0x00170503
|
||||||
|
//hda_set_node_power_state(codec, codec->core.afg, AC_PWRST_D3);
|
||||||
|
|
||||||
|
mycodec_info(codec, "command setup_gpio_set_10 end\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static void cs42l83_mic_detect(struct hda_codec *codec)
|
static void cs42l83_mic_detect(struct hda_codec *codec)
|
||||||
{
|
{
|
||||||
|
|
|
@ -928,6 +928,11 @@ static void cs_8409_play_data_ssm3(struct hda_codec *codec)
|
||||||
// 14,2 0x106b3600
|
// 14,2 0x106b3600
|
||||||
// 14,3 0x106b3900
|
// 14,3 0x106b3900
|
||||||
|
|
||||||
|
// imac subsystem ids
|
||||||
|
// 18,3 0x106b1000
|
||||||
|
// 19,1 0x106b1000
|
||||||
|
|
||||||
|
|
||||||
static int cs_8409_data_config(struct hda_codec *codec);
|
static int cs_8409_data_config(struct hda_codec *codec);
|
||||||
static int cs_8409_real_config(struct hda_codec *codec);
|
static int cs_8409_real_config(struct hda_codec *codec);
|
||||||
|
|
||||||
|
@ -940,7 +945,7 @@ static int cs_8409_boot_setup(struct hda_codec *codec)
|
||||||
// so it appears we break up the subsystem_id into 2 parts
|
// so it appears we break up the subsystem_id into 2 parts
|
||||||
// a codec vendor id (16 bits) and a subvendor id (8 bits) plus an assembly id
|
// a codec vendor id (16 bits) and a subvendor id (8 bits) plus an assembly id
|
||||||
// so here the codec vendor is 0x106b, the subvendor id is 0x39 and the assembly id is 0x00
|
// so here the codec vendor is 0x106b, the subvendor id is 0x39 and the assembly id is 0x00
|
||||||
if (codec->core.subsystem_id == 0x106b3900) {
|
if (codec->core.subsystem_id == 0x106b3900 || codec->core.subsystem_id == 0x106b1000) {
|
||||||
if (spec->use_data) {
|
if (spec->use_data) {
|
||||||
myprintk("snd_hda_intel: cs_8409_boot_setup pre cs_8409_data_config\n");
|
myprintk("snd_hda_intel: cs_8409_boot_setup pre cs_8409_data_config\n");
|
||||||
|
|
||||||
|
@ -975,7 +980,7 @@ static int cs_8409_boot_setup(struct hda_codec *codec)
|
||||||
void cs_8409_play_setup(struct hda_codec *codec)
|
void cs_8409_play_setup(struct hda_codec *codec)
|
||||||
{
|
{
|
||||||
struct cs_spec *spec = codec->spec;
|
struct cs_spec *spec = codec->spec;
|
||||||
if (codec->core.subsystem_id == 0x106b3900) {
|
if (codec->core.subsystem_id == 0x106b3900 || codec->core.subsystem_id == 0x106b1000) {
|
||||||
if (spec->use_data) {
|
if (spec->use_data) {
|
||||||
//cs_8409_unmute_data(codec);
|
//cs_8409_unmute_data(codec);
|
||||||
//cs_8409_volup_data(codec);
|
//cs_8409_volup_data(codec);
|
||||||
|
@ -1003,7 +1008,7 @@ void cs_8409_play_setup(struct hda_codec *codec)
|
||||||
void cs_8409_play_cleanup(struct hda_codec *codec)
|
void cs_8409_play_cleanup(struct hda_codec *codec)
|
||||||
{
|
{
|
||||||
struct cs_spec *spec = codec->spec;
|
struct cs_spec *spec = codec->spec;
|
||||||
if (codec->core.subsystem_id == 0x106b3900) {
|
if (codec->core.subsystem_id == 0x106b3900 || codec->core.subsystem_id == 0x106b1000) {
|
||||||
if (spec->use_data) {
|
if (spec->use_data) {
|
||||||
cs_8409_playstop_data(codec);
|
cs_8409_playstop_data(codec);
|
||||||
} else {
|
} else {
|
||||||
|
@ -1031,7 +1036,8 @@ void cs_8409_play_cleanup(struct hda_codec *codec)
|
||||||
void cs_8409_capture_setup(struct hda_codec *codec)
|
void cs_8409_capture_setup(struct hda_codec *codec)
|
||||||
{
|
{
|
||||||
struct cs_spec *spec = codec->spec;
|
struct cs_spec *spec = codec->spec;
|
||||||
if (codec->core.subsystem_id == 0x106b3300 || codec->core.subsystem_id == 0x106b3600 || codec->core.subsystem_id == 0x106b3900) {
|
if (codec->core.subsystem_id == 0x106b3300 || codec->core.subsystem_id == 0x106b3600 || codec->core.subsystem_id == 0x106b3900
|
||||||
|
|| codec->core.subsystem_id == 0x106b1000) {
|
||||||
if (spec->use_data) {
|
if (spec->use_data) {
|
||||||
//cs_8409_capture_data(codec);
|
//cs_8409_capture_data(codec);
|
||||||
} else {
|
} else {
|
||||||
|
@ -1048,7 +1054,8 @@ void cs_8409_capture_setup(struct hda_codec *codec)
|
||||||
void cs_8409_capture_cleanup(struct hda_codec *codec)
|
void cs_8409_capture_cleanup(struct hda_codec *codec)
|
||||||
{
|
{
|
||||||
struct cs_spec *spec = codec->spec;
|
struct cs_spec *spec = codec->spec;
|
||||||
if (codec->core.subsystem_id == 0x106b3300 || codec->core.subsystem_id == 0x106b3600 || codec->core.subsystem_id == 0x106b3900) {
|
if (codec->core.subsystem_id == 0x106b3300 || codec->core.subsystem_id == 0x106b3600 || codec->core.subsystem_id == 0x106b3900
|
||||||
|
|| codec->core.subsystem_id == 0x106b1000) {
|
||||||
if (spec->use_data) {
|
if (spec->use_data) {
|
||||||
//cs_8409_capturestop_data(codec);
|
//cs_8409_capturestop_data(codec);
|
||||||
} else {
|
} else {
|
||||||
|
@ -1175,7 +1182,7 @@ static void cs_8409_headset_mike_setup_nouse(struct hda_codec *codec)
|
||||||
void cs_8409_headplay_setup(struct hda_codec *codec)
|
void cs_8409_headplay_setup(struct hda_codec *codec)
|
||||||
{
|
{
|
||||||
struct cs_spec *spec = codec->spec;
|
struct cs_spec *spec = codec->spec;
|
||||||
if (codec->core.subsystem_id == 0x106b3900) {
|
if (codec->core.subsystem_id == 0x106b3900 || codec->core.subsystem_id == 0x106b1000) {
|
||||||
if (spec->use_data) {
|
if (spec->use_data) {
|
||||||
cs_8409_headplay_data(codec);
|
cs_8409_headplay_data(codec);
|
||||||
} else {
|
} else {
|
||||||
|
@ -1208,7 +1215,7 @@ void cs_8409_headplay_setup(struct hda_codec *codec)
|
||||||
void cs_8409_headplay_cleanup(struct hda_codec *codec)
|
void cs_8409_headplay_cleanup(struct hda_codec *codec)
|
||||||
{
|
{
|
||||||
struct cs_spec *spec = codec->spec;
|
struct cs_spec *spec = codec->spec;
|
||||||
if (codec->core.subsystem_id == 0x106b3900) {
|
if (codec->core.subsystem_id == 0x106b3900 || codec->core.subsystem_id == 0x106b1000) {
|
||||||
if (spec->use_data) {
|
if (spec->use_data) {
|
||||||
cs_8409_headplaystop_data(codec);
|
cs_8409_headplaystop_data(codec);
|
||||||
} else {
|
} else {
|
||||||
|
@ -1245,7 +1252,8 @@ void cs_8409_headplay_cleanup(struct hda_codec *codec)
|
||||||
void cs_8409_headcapture_setup(struct hda_codec *codec)
|
void cs_8409_headcapture_setup(struct hda_codec *codec)
|
||||||
{
|
{
|
||||||
struct cs_spec *spec = codec->spec;
|
struct cs_spec *spec = codec->spec;
|
||||||
if (codec->core.subsystem_id == 0x106b3300 || codec->core.subsystem_id == 0x106b3600 || codec->core.subsystem_id == 0x106b3900) {
|
if (codec->core.subsystem_id == 0x106b3300 || codec->core.subsystem_id == 0x106b3600 || codec->core.subsystem_id == 0x106b3900
|
||||||
|
|| codec->core.subsystem_id == 0x106b1000) {
|
||||||
if (spec->use_data) {
|
if (spec->use_data) {
|
||||||
//cs_8409_headcapture_data(codec);
|
//cs_8409_headcapture_data(codec);
|
||||||
} else {
|
} else {
|
||||||
|
@ -1270,7 +1278,8 @@ void cs_8409_headcapture_setup(struct hda_codec *codec)
|
||||||
void cs_8409_headcapture_cleanup(struct hda_codec *codec)
|
void cs_8409_headcapture_cleanup(struct hda_codec *codec)
|
||||||
{
|
{
|
||||||
struct cs_spec *spec = codec->spec;
|
struct cs_spec *spec = codec->spec;
|
||||||
if (codec->core.subsystem_id == 0x106b3300 || codec->core.subsystem_id == 0x106b3600 || codec->core.subsystem_id == 0x106b3900) {
|
if (codec->core.subsystem_id == 0x106b3300 || codec->core.subsystem_id == 0x106b3600 || codec->core.subsystem_id == 0x106b3900
|
||||||
|
|| codec->core.subsystem_id == 0x106b1000) {
|
||||||
if (spec->use_data) {
|
if (spec->use_data) {
|
||||||
//cs_8409_capturestop_data(codec);
|
//cs_8409_capturestop_data(codec);
|
||||||
} else {
|
} else {
|
||||||
|
|
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue