Commit eebaa6b0 authored by Pierre-Louis Bossart's avatar Pierre-Louis Bossart Committed by Takashi Iwai

ALSA: hda: ext: hda_ext_controller: use hlink variable/parameter

Follow the convention and use hlink for consistency.
No functionality change.
Signed-off-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: default avatarRanjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: default avatarRander Wang <rander.wang@intel.com>
Reviewed-by: default avatarPéter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: default avatarCezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20221019162115.185917-3-pierre-louis.bossart@linux.intel.comSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 056b6ccc
...@@ -117,17 +117,17 @@ struct hdac_ext_link { ...@@ -117,17 +117,17 @@ struct hdac_ext_link {
struct list_head list; struct list_head list;
}; };
int snd_hdac_ext_bus_link_power_up(struct hdac_ext_link *link); int snd_hdac_ext_bus_link_power_up(struct hdac_ext_link *hlink);
int snd_hdac_ext_bus_link_power_down(struct hdac_ext_link *link); int snd_hdac_ext_bus_link_power_down(struct hdac_ext_link *hlink);
int snd_hdac_ext_bus_link_power_up_all(struct hdac_bus *bus); int snd_hdac_ext_bus_link_power_up_all(struct hdac_bus *bus);
int snd_hdac_ext_bus_link_power_down_all(struct hdac_bus *bus); int snd_hdac_ext_bus_link_power_down_all(struct hdac_bus *bus);
void snd_hdac_ext_link_set_stream_id(struct hdac_ext_link *link, void snd_hdac_ext_link_set_stream_id(struct hdac_ext_link *hlink,
int stream); int stream);
void snd_hdac_ext_link_clear_stream_id(struct hdac_ext_link *link, void snd_hdac_ext_link_clear_stream_id(struct hdac_ext_link *hlink,
int stream); int stream);
int snd_hdac_ext_bus_link_get(struct hdac_bus *bus, struct hdac_ext_link *link); int snd_hdac_ext_bus_link_get(struct hdac_bus *bus, struct hdac_ext_link *hlink);
int snd_hdac_ext_bus_link_put(struct hdac_bus *bus, struct hdac_ext_link *link); int snd_hdac_ext_bus_link_put(struct hdac_bus *bus, struct hdac_ext_link *hlink);
void snd_hdac_ext_bus_link_power(struct hdac_device *codec, bool enable); void snd_hdac_ext_bus_link_power(struct hdac_device *codec, bool enable);
......
...@@ -115,12 +115,12 @@ EXPORT_SYMBOL_GPL(snd_hdac_ext_bus_get_ml_capabilities); ...@@ -115,12 +115,12 @@ EXPORT_SYMBOL_GPL(snd_hdac_ext_bus_get_ml_capabilities);
void snd_hdac_link_free_all(struct hdac_bus *bus) void snd_hdac_link_free_all(struct hdac_bus *bus)
{ {
struct hdac_ext_link *l; struct hdac_ext_link *hlink;
while (!list_empty(&bus->hlink_list)) { while (!list_empty(&bus->hlink_list)) {
l = list_first_entry(&bus->hlink_list, struct hdac_ext_link, list); hlink = list_first_entry(&bus->hlink_list, struct hdac_ext_link, list);
list_del(&l->list); list_del(&hlink->list);
kfree(l); kfree(hlink);
} }
} }
EXPORT_SYMBOL_GPL(snd_hdac_link_free_all); EXPORT_SYMBOL_GPL(snd_hdac_link_free_all);
...@@ -166,7 +166,7 @@ struct hdac_ext_link *snd_hdac_ext_bus_get_link(struct hdac_bus *bus, ...@@ -166,7 +166,7 @@ struct hdac_ext_link *snd_hdac_ext_bus_get_link(struct hdac_bus *bus,
} }
EXPORT_SYMBOL_GPL(snd_hdac_ext_bus_get_link); EXPORT_SYMBOL_GPL(snd_hdac_ext_bus_get_link);
static int check_hdac_link_power_active(struct hdac_ext_link *link, bool enable) static int check_hdac_link_power_active(struct hdac_ext_link *hlink, bool enable)
{ {
int timeout; int timeout;
u32 val; u32 val;
...@@ -176,7 +176,7 @@ static int check_hdac_link_power_active(struct hdac_ext_link *link, bool enable) ...@@ -176,7 +176,7 @@ static int check_hdac_link_power_active(struct hdac_ext_link *link, bool enable)
timeout = 150; timeout = 150;
do { do {
val = readl(link->ml_addr + AZX_REG_ML_LCTL); val = readl(hlink->ml_addr + AZX_REG_ML_LCTL);
if (enable) { if (enable) {
if (((val & mask) >> AZX_ML_LCTL_CPA_SHIFT)) if (((val & mask) >> AZX_ML_LCTL_CPA_SHIFT))
return 0; return 0;
...@@ -192,26 +192,26 @@ static int check_hdac_link_power_active(struct hdac_ext_link *link, bool enable) ...@@ -192,26 +192,26 @@ static int check_hdac_link_power_active(struct hdac_ext_link *link, bool enable)
/** /**
* snd_hdac_ext_bus_link_power_up -power up hda link * snd_hdac_ext_bus_link_power_up -power up hda link
* @link: HD-audio extended link * @hlink: HD-audio extended link
*/ */
int snd_hdac_ext_bus_link_power_up(struct hdac_ext_link *link) int snd_hdac_ext_bus_link_power_up(struct hdac_ext_link *hlink)
{ {
snd_hdac_updatel(link->ml_addr, AZX_REG_ML_LCTL, snd_hdac_updatel(hlink->ml_addr, AZX_REG_ML_LCTL,
AZX_ML_LCTL_SPA, AZX_ML_LCTL_SPA); AZX_ML_LCTL_SPA, AZX_ML_LCTL_SPA);
return check_hdac_link_power_active(link, true); return check_hdac_link_power_active(hlink, true);
} }
EXPORT_SYMBOL_GPL(snd_hdac_ext_bus_link_power_up); EXPORT_SYMBOL_GPL(snd_hdac_ext_bus_link_power_up);
/** /**
* snd_hdac_ext_bus_link_power_down -power down hda link * snd_hdac_ext_bus_link_power_down -power down hda link
* @link: HD-audio extended link * @hlink: HD-audio extended link
*/ */
int snd_hdac_ext_bus_link_power_down(struct hdac_ext_link *link) int snd_hdac_ext_bus_link_power_down(struct hdac_ext_link *hlink)
{ {
snd_hdac_updatel(link->ml_addr, AZX_REG_ML_LCTL, AZX_ML_LCTL_SPA, 0); snd_hdac_updatel(hlink->ml_addr, AZX_REG_ML_LCTL, AZX_ML_LCTL_SPA, 0);
return check_hdac_link_power_active(link, false); return check_hdac_link_power_active(hlink, false);
} }
EXPORT_SYMBOL_GPL(snd_hdac_ext_bus_link_power_down); EXPORT_SYMBOL_GPL(snd_hdac_ext_bus_link_power_down);
...@@ -254,7 +254,7 @@ int snd_hdac_ext_bus_link_power_down_all(struct hdac_bus *bus) ...@@ -254,7 +254,7 @@ int snd_hdac_ext_bus_link_power_down_all(struct hdac_bus *bus)
EXPORT_SYMBOL_GPL(snd_hdac_ext_bus_link_power_down_all); EXPORT_SYMBOL_GPL(snd_hdac_ext_bus_link_power_down_all);
int snd_hdac_ext_bus_link_get(struct hdac_bus *bus, int snd_hdac_ext_bus_link_get(struct hdac_bus *bus,
struct hdac_ext_link *link) struct hdac_ext_link *hlink)
{ {
unsigned long codec_mask; unsigned long codec_mask;
int ret = 0; int ret = 0;
...@@ -265,18 +265,18 @@ int snd_hdac_ext_bus_link_get(struct hdac_bus *bus, ...@@ -265,18 +265,18 @@ int snd_hdac_ext_bus_link_get(struct hdac_bus *bus,
* if we move from 0 to 1, count will be 1 so power up this link * if we move from 0 to 1, count will be 1 so power up this link
* as well, also check the dma status and trigger that * as well, also check the dma status and trigger that
*/ */
if (++link->ref_count == 1) { if (++hlink->ref_count == 1) {
if (!bus->cmd_dma_state) { if (!bus->cmd_dma_state) {
snd_hdac_bus_init_cmd_io(bus); snd_hdac_bus_init_cmd_io(bus);
bus->cmd_dma_state = true; bus->cmd_dma_state = true;
} }
ret = snd_hdac_ext_bus_link_power_up(link); ret = snd_hdac_ext_bus_link_power_up(hlink);
/* /*
* clear the register to invalidate all the output streams * clear the register to invalidate all the output streams
*/ */
snd_hdac_updatew(link->ml_addr, AZX_REG_ML_LOSIDV, snd_hdac_updatew(hlink->ml_addr, AZX_REG_ML_LOSIDV,
AZX_ML_LOSIDV_STREAM_MASK, 0); AZX_ML_LOSIDV_STREAM_MASK, 0);
/* /*
* wait for 521usec for codec to report status * wait for 521usec for codec to report status
...@@ -296,10 +296,10 @@ int snd_hdac_ext_bus_link_get(struct hdac_bus *bus, ...@@ -296,10 +296,10 @@ int snd_hdac_ext_bus_link_get(struct hdac_bus *bus,
EXPORT_SYMBOL_GPL(snd_hdac_ext_bus_link_get); EXPORT_SYMBOL_GPL(snd_hdac_ext_bus_link_get);
int snd_hdac_ext_bus_link_put(struct hdac_bus *bus, int snd_hdac_ext_bus_link_put(struct hdac_bus *bus,
struct hdac_ext_link *link) struct hdac_ext_link *hlink)
{ {
int ret = 0; int ret = 0;
struct hdac_ext_link *hlink; struct hdac_ext_link *hlink_tmp;
bool link_up = false; bool link_up = false;
mutex_lock(&bus->lock); mutex_lock(&bus->lock);
...@@ -308,15 +308,15 @@ int snd_hdac_ext_bus_link_put(struct hdac_bus *bus, ...@@ -308,15 +308,15 @@ int snd_hdac_ext_bus_link_put(struct hdac_bus *bus,
* if we move from 1 to 0, count will be 0 * if we move from 1 to 0, count will be 0
* so power down this link as well * so power down this link as well
*/ */
if (--link->ref_count == 0) { if (--hlink->ref_count == 0) {
ret = snd_hdac_ext_bus_link_power_down(link); ret = snd_hdac_ext_bus_link_power_down(hlink);
/* /*
* now check if all links are off, if so turn off * now check if all links are off, if so turn off
* cmd dma as well * cmd dma as well
*/ */
list_for_each_entry(hlink, &bus->hlink_list, list) { list_for_each_entry(hlink_tmp, &bus->hlink_list, list) {
if (hlink->ref_count) { if (hlink_tmp->ref_count) {
link_up = true; link_up = true;
break; break;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment