aboutsummaryrefslogtreecommitdiffstats
path: root/include/sound/hdaudio.h
diff options
context:
space:
mode:
authorKai Vehmanen <kai.vehmanen@linux.intel.com>2021-02-05 20:46:28 +0200
committerTakashi Iwai <tiwai@suse.de>2021-02-08 15:56:35 +0100
commitf9e5fd1b666e9d34c94b91808bda02c2d4d00776 (patch)
treeae397987c95a1098e4bee6e6f77b6c6a897dc6e6 /include/sound/hdaudio.h
parentALSA: azt3328: Assign boolean values to a bool variable (diff)
downloadlinux-dev-f9e5fd1b666e9d34c94b91808bda02c2d4d00776.tar.xz
linux-dev-f9e5fd1b666e9d34c94b91808bda02c2d4d00776.zip
ALSA: hda: add link_power op to hdac_bus_ops
The extended HDA bus (hdac_ext) provides interfaces for more fine-grained control of individual links than what plain HDA provides for. Links can be powered off when they are not used and if all links are released, controller can shut down the command DMA. These interfaces are currently not used by common HDA codec drivers. When a HDA codec is runtime suspended, it calls snd_hdac_codec_link_down(), but there is no link to the HDA extended bus, and on controller side the links are shut down only when all codecs are suspended. This patch adds link_power() to hdac_bus ops. Controllers using the HDA extended core, can use this to plug in snd_hdac_ext_bus_link_power() to implement more fine-grained control of link power. No change is needed for plain HDA controllers nor to existing HDA codec drivers. Co-developed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Acked-by: Mark Brown <broonie@kernel.org> Link: https://lore.kernel.org/r/20210205184630.1938761-2-kai.vehmanen@linux.intel.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'include/sound/hdaudio.h')
-rw-r--r--include/sound/hdaudio.h14
1 files changed, 5 insertions, 9 deletions
diff --git a/include/sound/hdaudio.h b/include/sound/hdaudio.h
index 6eed61e6cf8a..22af68b01426 100644
--- a/include/sound/hdaudio.h
+++ b/include/sound/hdaudio.h
@@ -241,6 +241,8 @@ struct hdac_bus_ops {
/* get a response from the last command */
int (*get_response)(struct hdac_bus *bus, unsigned int addr,
unsigned int *res);
+ /* notify of codec link power-up/down */
+ void (*link_power)(struct hdac_device *hdev, bool enable);
};
/*
@@ -378,15 +380,8 @@ void snd_hdac_bus_exit(struct hdac_bus *bus);
int snd_hdac_bus_exec_verb_unlocked(struct hdac_bus *bus, unsigned int addr,
unsigned int cmd, unsigned int *res);
-static inline void snd_hdac_codec_link_up(struct hdac_device *codec)
-{
- set_bit(codec->addr, &codec->bus->codec_powered);
-}
-
-static inline void snd_hdac_codec_link_down(struct hdac_device *codec)
-{
- clear_bit(codec->addr, &codec->bus->codec_powered);
-}
+void snd_hdac_codec_link_up(struct hdac_device *codec);
+void snd_hdac_codec_link_down(struct hdac_device *codec);
int snd_hdac_bus_send_cmd(struct hdac_bus *bus, unsigned int val);
int snd_hdac_bus_get_response(struct hdac_bus *bus, unsigned int addr,
@@ -400,6 +395,7 @@ void snd_hdac_bus_stop_cmd_io(struct hdac_bus *bus);
void snd_hdac_bus_enter_link_reset(struct hdac_bus *bus);
void snd_hdac_bus_exit_link_reset(struct hdac_bus *bus);
int snd_hdac_bus_reset_link(struct hdac_bus *bus, bool full_reset);
+void snd_hdac_bus_link_power(struct hdac_device *hdev, bool enable);
void snd_hdac_bus_update_rirb(struct hdac_bus *bus);
int snd_hdac_bus_handle_stream_irq(struct hdac_bus *bus, unsigned int status,