Skip to content

Commit

Permalink
ASoC: Intel: hdac_hdmi: add Icelake support
Browse files Browse the repository at this point in the history
Add Icelake device id. Also, Icelake's pin2port mapping table is
different from previous platforms. So add .base_nid at drv_data
to use different base for different platforms.

Signed-off-by: Bard liao <bard.liao@intel.com>
  • Loading branch information
bardliao committed Nov 2, 2018
1 parent a5ddc3d commit 9fb80f4
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion sound/soc/codecs/hdac_hdmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ struct hdac_hdmi_dai_port_map {

struct hdac_hdmi_drv_data {
unsigned int vendor_nid;
unsigned int base_nid;
};

struct hdac_hdmi_priv {
Expand Down Expand Up @@ -1538,7 +1539,11 @@ static int hdac_hdmi_parse_and_map_nid(struct hdac_device *hdev,

static int hdac_hdmi_pin2port(void *aptr, int pin)
{
return pin - 4; /* map NID 0x05 -> port #1 */
struct hdac_device *hdev = aptr;
struct hdac_hdmi_priv *hdmi = hdev_to_hdmi_priv(hdev);
unsigned int base_nid = hdmi->drv_data->base_nid;

return pin - base_nid + 1; /* intel port is 1-based */
}

static void hdac_hdmi_eld_notify_cb(void *aptr, int port, int pipe)
Expand Down Expand Up @@ -1973,12 +1978,19 @@ static int hdac_hdmi_get_spk_alloc(struct hdac_device *hdev, int pcm_idx)
return port->eld.info.spk_alloc;
}

static struct hdac_hdmi_drv_data intel_icl_drv_data = {
.vendor_nid = INTEL_VENDOR_NID,
.base_nid = 4,
};

static struct hdac_hdmi_drv_data intel_glk_drv_data = {
.vendor_nid = INTEL_GLK_VENDOR_NID,
.base_nid = 5,
};

static struct hdac_hdmi_drv_data intel_drv_data = {
.vendor_nid = INTEL_VENDOR_NID,
.base_nid = 5,
};

static int hdac_hdmi_dev_probe(struct hdac_device *hdev)
Expand Down Expand Up @@ -2259,6 +2271,8 @@ static const struct hda_device_id hdmi_list[] = {
&intel_glk_drv_data),
HDA_CODEC_EXT_ENTRY(0x8086280d, 0x100000, "Geminilake HDMI",
&intel_glk_drv_data),
HDA_CODEC_EXT_ENTRY(0x8086280f, 0x100000, "Icelake HDMI",
&intel_icl_drv_data),
{}
};

Expand Down

0 comments on commit 9fb80f4

Please sign in to comment.