* add some helper functions to read/write verbs.
* try at support realtek alc888. alsa uses this init sequence. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37113 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -354,6 +354,8 @@ void hda_hw_stop(hda_controller* controller);
|
|||||||
void hda_hw_uninit(hda_controller* controller);
|
void hda_hw_uninit(hda_controller* controller);
|
||||||
status_t hda_send_verbs(hda_codec* codec, corb_t* verbs, uint32* responses,
|
status_t hda_send_verbs(hda_codec* codec, corb_t* verbs, uint32* responses,
|
||||||
uint32 count);
|
uint32 count);
|
||||||
|
status_t hda_verb_write(hda_codec* codec, uint32 nid, uint32 vid, uint8 payload);
|
||||||
|
status_t hda_verb_read(hda_codec* codec, uint32 nid, uint32 vid, uint32 *response);
|
||||||
|
|
||||||
/* hda_controller.c: Stream support */
|
/* hda_controller.c: Stream support */
|
||||||
hda_stream* hda_stream_new(hda_audio_group* audioGroup, int type);
|
hda_stream* hda_stream_new(hda_audio_group* audioGroup, int type);
|
||||||
|
|||||||
@@ -653,6 +653,8 @@ hda_codec_parse_audio_group(hda_audio_group* audioGroup)
|
|||||||
corb_t verbs[3];
|
corb_t verbs[3];
|
||||||
uint32 resp[3];
|
uint32 resp[3];
|
||||||
|
|
||||||
|
hda_codec* codec = audioGroup->codec;
|
||||||
|
uint32 codec_id = (codec->vendor_id << 16) | codec->product_id;
|
||||||
hda_widget_get_stream_support(audioGroup, &audioGroup->widget);
|
hda_widget_get_stream_support(audioGroup, &audioGroup->widget);
|
||||||
hda_widget_get_pm_support(audioGroup, &audioGroup->widget);
|
hda_widget_get_pm_support(audioGroup, &audioGroup->widget);
|
||||||
hda_widget_get_amplifier_capabilities(audioGroup, &audioGroup->widget);
|
hda_widget_get_amplifier_capabilities(audioGroup, &audioGroup->widget);
|
||||||
@@ -707,7 +709,7 @@ hda_codec_parse_audio_group(hda_audio_group* audioGroup)
|
|||||||
>> AUDIO_CAP_TYPE_SHIFT);
|
>> AUDIO_CAP_TYPE_SHIFT);
|
||||||
|
|
||||||
/* Check specific node ids declared as inputs as beepers */
|
/* Check specific node ids declared as inputs as beepers */
|
||||||
switch ((audioGroup->codec->vendor_id << 16) | audioGroup->codec->product_id) {
|
switch (codec_id) {
|
||||||
case 0x11d41882:
|
case 0x11d41882:
|
||||||
case 0x11d41883:
|
case 0x11d41883:
|
||||||
case 0x11d41884:
|
case 0x11d41884:
|
||||||
@@ -812,6 +814,19 @@ hda_codec_parse_audio_group(hda_audio_group* audioGroup)
|
|||||||
|
|
||||||
hda_widget_get_associations(audioGroup);
|
hda_widget_get_associations(audioGroup);
|
||||||
|
|
||||||
|
// init the codecs
|
||||||
|
switch (codec_id) {
|
||||||
|
case 0x10ec0888: {
|
||||||
|
hda_verb_write(codec, 0x20, VID_SET_COEFFICIENT_INDEX, 0x0);
|
||||||
|
uint32 tmp;
|
||||||
|
hda_verb_read(codec, 0x20, VID_GET_PROCESSING_COEFFICIENT, &tmp);
|
||||||
|
hda_verb_write(codec, 0x20, VID_SET_COEFFICIENT_INDEX, 0x7);
|
||||||
|
hda_verb_write(codec, 0x20, VID_SET_PROCESSING_COEFFICIENT,
|
||||||
|
(tmp & 0xf0) == 0x20 ? 0x830 : 0x3030);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -774,6 +774,22 @@ hda_send_verbs(hda_codec* codec, corb_t* verbs, uint32* responses, uint32 count)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
status_t
|
||||||
|
hda_verb_write(hda_codec* codec, uint32 nid, uint32 vid, uint8 payload)
|
||||||
|
{
|
||||||
|
corb_t verb = MAKE_VERB(codec->addr, nid, vid, payload);
|
||||||
|
return hda_send_verbs(codec, &verb, NULL, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
status_t
|
||||||
|
hda_verb_read(hda_codec* codec, uint32 nid, uint32 vid, uint32 *response)
|
||||||
|
{
|
||||||
|
corb_t verb = MAKE_VERB(codec->addr, nid, vid, 0);
|
||||||
|
return hda_send_verbs(codec, &verb, response, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*! Setup hardware for use; detect codecs; etc */
|
/*! Setup hardware for use; detect codecs; etc */
|
||||||
status_t
|
status_t
|
||||||
hda_hw_init(hda_controller* controller)
|
hda_hw_init(hda_controller* controller)
|
||||||
|
|||||||
Reference in New Issue
Block a user