Enable HDA Codec support on Intel Platforms (Series1)
Subsystems (3)
cover Enable HDA Codec support on Intel Platforms (Series1)
Enhanced HD Audio capabilities introduced in HD Audio controllers are added in backward compatible way i.e. it does not change the behavior of the controller with respect to HDA Bus and HDA devices.
Since there is no change in the hardware with respect to the HDA bus and HDA device it is more appropriate to represent the same in software as well.
In order to align software representation with hardware it makes more sense to have common data structures across device, bus and driver for both enhanced HDA controllers and legacy HDA controllers.
This patch series removes the hdac_ext_device structure, hdac_ext_bus and hdac_ext_driver data structures so that legacy and enhanced HDaudio capabilities can be handled in a backward-compatible way without separate definitions.
Once this clean-up is complete, additional patches will allow for HDaudio codec support in an ASoC framework without the need to develop new codec drivers, thereby enabling the use of the Intel DSP on more platforms (currently limited to hdmi).
Rakesh Ughreja (3):
ALSA: hdac: Remove usage of struct hdac_ext_device and use hdac_device
instead
ALSA: hdac: Remove usage of struct hdac_ext_bus and use hdac_bus
instead
ALSA: hdac: Remove usage of struct hdac_ext_driver, use hdac_driver
instead
include/sound/hdaudio.h | 20 ++ include/sound/hdaudio_ext.h | 119 +++------- sound/hda/ext/hdac_ext_bus.c | 76 +++--- sound/hda/ext/hdac_ext_controller.c | 55 +++-- sound/hda/ext/hdac_ext_stream.c | 104 ++++----- sound/soc/codecs/hdac_hdmi.c | 416 ++++++++++++++++----------------- sound/soc/intel/skylake/skl-messages.c | 50 ++-- sound/soc/intel/skylake/skl-nhlt.c | 8 +- sound/soc/intel/skylake/skl-pcm.c | 112 +++++---- sound/soc/intel/skylake/skl-topology.c | 18 +- sound/soc/intel/skylake/skl-topology.h | 6 +- sound/soc/intel/skylake/skl.c | 178 +++++++------- sound/soc/intel/skylake/skl.h | 7 +- 13 files changed, 521 insertions(+), 648 deletions(-)
Signature · 1 line
2.7.4
PATCH 1/3 ALSA: hdac: Remove usage of struct hdac_ext_device and use hdac_device instead
This patch removes the hdac_ext_device structure. The legacy and enhanced HDaudio capabilities can be handled in a backward-compatible way without separate definitions.
Follow-up patches in this series handle the bus and driver definitions.
--- include/sound/hdaudio_ext.h | 36 +--- sound/hda/ext/hdac_ext_bus.c | 25 ++- sound/soc/codecs/hdac_hdmi.c | 396 +++++++++++++++++++++---------------------- 3 files changed, 204 insertions(+), 253 deletions(-)
include/sound/hdaudio_ext.h +4 -32
@@ -181,48 +181,20 @@ struct hda_dai_map {u32 maxbps; }; -#define HDA_MAX_NIDS 16 - -/** -* struct hdac_ext_device - HDAC Ext device -* -* @hdac: hdac core device -* @nid_list - the dai map which matches the dai-name with the nid -* @map_cur_idx - the idx in use in dai_map -* @ops - the hda codec ops common to all codec drivers -* @pvt_data - private data, for asoc contains asoc codec object -*/ -struct hdac_ext_device { -struct hdac_device hdev; -struct hdac_ext_bus *ebus; - -/* soc-dai to nid map */ -struct hda_dai_map nid_list[HDA_MAX_NIDS ]; -unsigned int map_cur_idx; - -/* codec ops */ -struct hdac_ext_codec_ops ops; - -struct snd_card *card; -void *scodec; -void *private_data; -}; -struct hdac_ext_dma_params {u32 format;u8 stream_tag; }; -#define to_ehdac_device (dev) (container_of((dev), \ - struct hdac_ext_device, hdev)) +/* * HD-audio codec base driver */ struct hdac_ext_driver {struct hdac_driver hdac; -int (*probe)(struct hdac_ext_device *dev); -int (*remove)(struct hdac_ext_device *dev); -void (*shutdown)(struct hdac_ext_device *dev); +int (*probe)(struct hdac_device *dev); +int (*remove)(struct hdac_device *dev); +void (*shutdown)(struct hdac_device *dev); };int snd_hda_ext_driver_register (struct hdac_ext_driver *drv);
sound/hda/ext/hdac_ext_bus.c +10 -15
@@ -137,17 +137,16 @@ static void default_release(struct device *dev)*/ int snd_hdac_ext_bus_device_init (struct hdac_ext_bus *ebus,int addr) { -struct hdac_ext_device *edev;struct hdac_device *hdev =NULL ;struct hdac_bus *bus =ebus_to_hbus (ebus);char name[15 ];int ret; - edev =kzalloc (sizeof (*edev),GFP_KERNEL ); -if (!edev) + hdev =kzalloc (sizeof (*hdev),GFP_KERNEL ); +if (!hdev)return -ENOMEM ; - hdev = &edev->hdev; - edev->ebus = ebus; + + hdev->bus = bus;snprintf (name,sizeof (name),"ehdaudio%dD%d" , ebus->idx, addr);
@@ -176,10 +175,8 @@ EXPORT_SYMBOL_GPL(snd_hdac_ext_bus_device_init);*/ void snd_hdac_ext_bus_device_exit (struct hdac_device *hdev) { -struct hdac_ext_device *edev =to_ehdac_device (hdev); -snd_hdac_device_exit (hdev); -kfree (edev); +kfree (hdev); }EXPORT_SYMBOL_GPL (snd_hdac_ext_bus_device_exit);
@@ -212,27 +209,25 @@ static inline struct hdac_ext_driver *get_edrv(struct device *dev)return edrv; } -static inline struct hdac_ext_device *get_edev (struct device *dev) +static inline struct hdac_device *get_hdev (struct device *dev) {struct hdac_device *hdev =dev_to_hdac_dev (dev); -struct hdac_ext_device *edev =to_ehdac_device (hdev); - -return edev; +return hdev; }static int hda_ext_drv_probe (struct device *dev) { -return (get_edrv (dev))->probe (get_edev (dev)); +return (get_edrv (dev))->probe (get_hdev (dev)); }static int hdac_ext_drv_remove (struct device *dev) { -return (get_edrv (dev))->remove (get_edev (dev)); +return (get_edrv (dev))->remove (get_hdev (dev)); }static void hdac_ext_drv_shutdown (struct device *dev) { -return (get_edrv (dev))->shutdown (get_edev (dev)); +return (get_edrv (dev))->shutdown (get_hdev (dev)); }/**
sound/soc/codecs/hdac_hdmi.c +190 -206
1,131 lines not on this page · raw message
Signature · 1 line
2.7.4
PATCH 2/3 ALSA: hdac: Remove usage of struct hdac_ext_bus and use hdac_bus instead
In reply to Rakesh UghrejaThis patch removes the hdac_ext_bus structure. The legacy and enhanced HDaudio capabilities can be handled in a backward-compatible way without separate definitions.
Follow-up patches in this series handle the driver definition.
--- include/sound/hdaudio.h | 15 +++ include/sound/hdaudio_ext.h | 74 +++++--------- sound/hda/ext/hdac_ext_bus.c | 27 +++-- sound/hda/ext/hdac_ext_controller.c | 55 +++++----- sound/hda/ext/hdac_ext_stream.c | 104 +++++++++---------- sound/soc/codecs/hdac_hdmi.c | 22 ++-- sound/soc/intel/skylake/skl-messages.c | 50 ++++----- sound/soc/intel/skylake/skl-nhlt.c | 8 +- sound/soc/intel/skylake/skl-pcm.c | 112 ++++++++++----------- sound/soc/intel/skylake/skl-topology.c | 18 ++-- sound/soc/intel/skylake/skl-topology.h | 6 +- sound/soc/intel/skylake/skl.c | 178 +++++++++++++++------------------ sound/soc/intel/skylake/skl.h | 7 +- 13 files changed, 305 insertions(+), 371 deletions(-)
include/sound/hdaudio.h +15 -0
@@ -253,6 +253,11 @@ struct hdac_rb {* @mlcap: MultiLink capabilities pointer * @gtscap: gts capabilities pointer * @drsmcap: dma resume capabilities pointer +* @num_streams: streams supported +* @idx: HDA link index +* @hlink_list: link list of HDA links +* @lock: lock for link mgmt +* @cmd_dma_state: state of cmd DMAs: CORB and RIRB */ struct hdac_bus {struct device *dev;
@@ -320,6 +325,16 @@ struct hdac_bus {/* i915 component interface */ struct i915_audio_component *audio_component;int i915_power_refcount; + +/* parameters required for enhanced capabilities */ +int num_streams; +int idx; + +struct list_head hlink_list; + +struct mutex lock; +bool cmd_dma_state; + }; int snd_hdac_bus_init(struct hdac_bus *bus, struct device *dev,
include/sound/hdaudio_ext.h +24 -50
121 lines not on this page · raw message
sound/hda/ext/hdac_ext_bus.c +13 -14
@@ -87,7 +87,7 @@ static const struct hdac_io_ops hdac_ext_default_io = {* * Returns 0 if successful, or a negative error code. */ -int snd_hdac_ext_bus_init (struct hdac_ext_bus *ebus,struct device *dev, +int snd_hdac_ext_bus_init (struct hdac_bus *bus,struct device *dev,const struct hdac_bus_ops *ops,const struct hdac_io_ops *io_ops) {
@@ -98,15 +98,15 @@ int snd_hdac_ext_bus_init(struct hdac_ext_bus *ebus, struct device *dev,if (io_ops ==NULL ) io_ops = &hdac_ext_default_io; - ret =snd_hdac_bus_init (&ebus->bus, dev, ops, io_ops); + ret =snd_hdac_bus_init (bus, dev, ops, io_ops);if (ret <0 )return ret; -INIT_LIST_HEAD (&ebus->hlink_list); - ebus->idx = idx++; +INIT_LIST_HEAD (&bus->hlink_list); + bus->idx = idx++; -mutex_init (&ebus->lock); - ebus->cmd_dma_state = true; +mutex_init (&bus->lock); + bus->cmd_dma_state = true;return 0 ; }
@@ -116,10 +116,10 @@ EXPORT_SYMBOL_GPL(snd_hdac_ext_bus_init);* snd_hdac_ext_bus_exit - clean up a HD-audio extended bus * @ebus: the pointer to extended bus object */ -void snd_hdac_ext_bus_exit (struct hdac_ext_bus *ebus) +void snd_hdac_ext_bus_exit (struct hdac_bus *bus) { -snd_hdac_bus_exit (&ebus->bus); -WARN_ON (!list_empty (&ebus->hlink_list)); +snd_hdac_bus_exit (bus); +WARN_ON (!list_empty (&bus->hlink_list)); }EXPORT_SYMBOL_GPL (snd_hdac_ext_bus_exit);
@@ -135,10 +135,9 @@ static void default_release(struct device *dev)* * Returns zero for success or a negative error code. */ -int snd_hdac_ext_bus_device_init (struct hdac_ext_bus *ebus,int addr) +int snd_hdac_ext_bus_device_init (struct hdac_bus *bus,int addr) {struct hdac_device *hdev =NULL ; -struct hdac_bus *bus =ebus_to_hbus (ebus);char name[15 ];int ret;
@@ -148,7 +147,7 @@ int snd_hdac_ext_bus_device_init(struct hdac_ext_bus *ebus, int addr) hdev->bus = bus; -snprintf (name,sizeof (name),"ehdaudio%dD%d" , ebus->idx, addr); +snprintf (name,sizeof (name),"ehdaudio%dD%d" , bus->idx, addr); ret =snd_hdac_device_init (hdev, bus, name, addr);if (ret <0 ) {
@@ -185,14 +184,14 @@ EXPORT_SYMBOL_GPL(snd_hdac_ext_bus_device_exit);* * @ebus: HD-audio extended bus */ -void snd_hdac_ext_bus_device_remove (struct hdac_ext_bus *ebus) +void snd_hdac_ext_bus_device_remove (struct hdac_bus *bus) {struct hdac_device *codec, *__codec;/* * we need to remove all the codec devices objects created in the * snd_hdac_ext_bus_device_init */ -list_for_each_entry_safe (codec, __codec, &ebus->bus.codec_list, list) { +list_for_each_entry_safe (codec, __codec, &bus->codec_list, list) {snd_hdac_device_unregister (codec);put_device (&codec->dev); }
sound/hda/ext/hdac_ext_controller.c +26 -29
174 lines not on this page · raw message
sound/hda/ext/hdac_ext_stream.c +45 -59
338 lines not on this page · raw message
sound/soc/codecs/hdac_hdmi.c +9 -13
@@ -1799,14 +1799,13 @@ static int hdmi_codec_probe(struct snd_soc_component *component)* hold the ref while we probe, also no need to drop the ref on * exit, we call pm_runtime_suspend() so that will do for us */ - hlink =snd_hdac_ext_bus_get_link (hbus_to_ebus (hdev->bus), -dev_name (&hdev->dev)); + hlink =snd_hdac_ext_bus_get_link (hdev->bus,dev_name (&hdev->dev));if (!hlink) {dev_err (&hdev->dev,"hdac link not found\n" );return -EIO ; } -snd_hdac_ext_bus_link_get (hbus_to_ebus (hdev->bus), hlink); +snd_hdac_ext_bus_link_get (hdev->bus, hlink); ret =create_fill_widget_route_map (dapm);if (ret <0 )
@@ -1984,14 +1983,13 @@ static int hdac_hdmi_dev_probe(struct hdac_device *hdev)const struct hda_device_id *hdac_id =hdac_get_device_id (hdev, hdrv);/* hold the ref while we probe */ - hlink =snd_hdac_ext_bus_get_link (hbus_to_ebus (hdev->bus), -dev_name (&hdev->dev)); + hlink =snd_hdac_ext_bus_get_link (hdev->bus,dev_name (&hdev->dev));if (!hlink) {dev_err (&hdev->dev,"hdac link not found\n" );return -EIO ; } -snd_hdac_ext_bus_link_get (hbus_to_ebus (hdev->bus), hlink); +snd_hdac_ext_bus_link_get (hdev->bus, hlink); hdmi_priv =devm_kzalloc (&hdev->dev,sizeof (*hdmi_priv),GFP_KERNEL );if (hdmi_priv ==NULL )
@@ -2044,7 +2042,7 @@ static int hdac_hdmi_dev_probe(struct hdac_device *hdev) ret =devm_snd_soc_register_component (&hdev->dev, &hdmi_hda_codec, hdmi_dais, num_dais); -snd_hdac_ext_bus_link_put (hbus_to_ebus (hdev->bus), hlink); +snd_hdac_ext_bus_link_put (hdev->bus, hlink);return ret; }
@@ -2093,7 +2091,6 @@ static int hdac_hdmi_runtime_suspend(struct device *dev) {struct hdac_device *hdev =dev_to_hdac_dev (dev);struct hdac_bus *bus = hdev->bus; -struct hdac_ext_bus *ebus =hbus_to_ebus (bus);struct hdac_ext_link *hlink =NULL ;int err;
@@ -2118,13 +2115,13 @@ static int hdac_hdmi_runtime_suspend(struct device *dev)return err; } - hlink =snd_hdac_ext_bus_get_link (ebus,dev_name (dev)); + hlink =snd_hdac_ext_bus_get_link (bus,dev_name (dev));if (!hlink) {dev_err (dev,"hdac link not found\n" );return -EIO ; } -snd_hdac_ext_bus_link_put (ebus, hlink); +snd_hdac_ext_bus_link_put (bus, hlink);return 0 ; }
@@ -2133,7 +2130,6 @@ static int hdac_hdmi_runtime_resume(struct device *dev) {struct hdac_device *hdev =dev_to_hdac_dev (dev);struct hdac_bus *bus = hdev->bus; -struct hdac_ext_bus *ebus =hbus_to_ebus (bus);struct hdac_ext_link *hlink =NULL ;int err;
@@ -2143,13 +2139,13 @@ static int hdac_hdmi_runtime_resume(struct device *dev)if (!bus)return 0 ; - hlink =snd_hdac_ext_bus_get_link (ebus,dev_name (dev)); + hlink =snd_hdac_ext_bus_get_link (bus,dev_name (dev));if (!hlink) {dev_err (dev,"hdac link not found\n" );return -EIO ; } -snd_hdac_ext_bus_link_get (ebus, hlink); +snd_hdac_ext_bus_link_get (bus, hlink); err =snd_hdac_display_power (bus, true);if (err <0 ) {
sound/soc/intel/skylake/skl-messages.c +22 -28
151 lines not on this page · raw message
sound/soc/intel/skylake/skl-nhlt.c +4 -4
@@ -141,7 +141,7 @@ struct nhlt_specific_cfg {struct nhlt_fmt *fmt;struct nhlt_endpoint *epnt; -struct hdac_bus *bus =ebus_to_hbus (&skl->ebus); +struct hdac_bus *bus =skl_to_bus (skl);struct device *dev = bus->dev;struct nhlt_specific_cfg *sp_config;struct nhlt_acpi_table *nhlt = skl->nhlt;
@@ -228,7 +228,7 @@ static void skl_nhlt_trim_space(char *trim)int skl_nhlt_update_topology_bin (struct skl *skl) {struct nhlt_acpi_table *nhlt = (struct nhlt_acpi_table *)skl->nhlt; -struct hdac_bus *bus =ebus_to_hbus (&skl->ebus); +struct hdac_bus *bus =skl_to_bus (skl);struct device *dev = bus->dev; dev_dbg(dev, "oem_id %.6s, oem_table_id %8s oem_revision %d\n",
@@ -248,8 +248,8 @@ static ssize_t skl_nhlt_platform_id_show(struct device *dev, struct device_attribute *attr, char *buf) { struct pci_dev *pci = to_pci_dev(dev); -struct hdac_ext_bus *ebus =pci_get_drvdata (pci); -struct skl *skl =ebus_to_skl (ebus); +struct hdac_bus *bus =pci_get_drvdata (pci); +struct skl *skl =bus_to_skl (bus);struct nhlt_acpi_table *nhlt = (struct nhlt_acpi_table *)skl->nhlt;char platform_id[32 ];
sound/soc/intel/skylake/skl-pcm.c +54 -58
368 lines not on this page · raw message
sound/soc/intel/skylake/skl-topology.c +7 -11
@@ -2771,9 +2771,8 @@ static int skl_tplg_widget_load(struct snd_soc_component *cmpnt, struct snd_soc_tplg_dapm_widget *tplg_w) {int ret; -struct hdac_ext_bus *ebus =snd_soc_component_get_drvdata (cmpnt); -struct skl *skl =ebus_to_skl (ebus); -struct hdac_bus *bus =ebus_to_hbus (ebus); +struct hdac_bus *bus =snd_soc_component_get_drvdata (cmpnt); +struct skl *skl =bus_to_skl (bus);struct skl_module_cfg *mconfig;if (!tplg_w->priv.size)
@@ -2879,8 +2878,7 @@ static int skl_tplg_control_load(struct snd_soc_component *cmpnt,struct soc_bytes_ext *sb;struct snd_soc_tplg_bytes_control *tplg_bc;struct snd_soc_tplg_enum_control *tplg_ec; -struct hdac_ext_bus *ebus =snd_soc_component_get_drvdata (cmpnt); -struct hdac_bus *bus =ebus_to_hbus (ebus); +struct hdac_bus *bus =snd_soc_component_get_drvdata (cmpnt);struct soc_enum *se;switch (hdr->ops.info) {
@@ -3364,9 +3362,8 @@ static int skl_tplg_get_manifest_data(struct snd_soc_tplg_manifest *manifest,static int skl_manifest_load (struct snd_soc_component *cmpnt,struct snd_soc_tplg_manifest *manifest) { -struct hdac_ext_bus *ebus =snd_soc_component_get_drvdata (cmpnt); -struct hdac_bus *bus =ebus_to_hbus (ebus); -struct skl *skl =ebus_to_skl (ebus); +struct hdac_bus *bus =snd_soc_component_get_drvdata (cmpnt); +struct skl *skl =bus_to_skl (bus);/* proceed only if we have private data defined */ if (manifest->priv.size ==0 )
@@ -3455,12 +3452,11 @@ static void skl_tplg_set_pipe_type(struct skl *skl, struct skl_pipe *pipe)/* * SKL topology init routine */ -int skl_tplg_init (struct snd_soc_component *component,struct hdac_ext_bus *ebus) +int skl_tplg_init (struct snd_soc_component *component,struct hdac_bus *bus) {int ret;const struct firmware *fw; -struct hdac_bus *bus =ebus_to_hbus (ebus); -struct skl *skl =ebus_to_skl (ebus); +struct skl *skl =bus_to_skl (bus);struct skl_pipeline *ppl; ret =request_firmware (&fw, skl->tplg_name, bus->dev);
sound/soc/intel/skylake/skl-topology.h +3 -3
@@ -449,9 +449,9 @@ enum skl_channel {static inline struct skl *get_skl_ctx (struct device *dev) { -struct hdac_ext_bus *ebus =dev_get_drvdata (dev); +struct hdac_bus *bus =dev_get_drvdata (dev); -return ebus_to_skl (ebus); +return bus_to_skl (bus); } int skl_tplg_be_update_params(struct snd_soc_dai *dai,
@@ -461,7 +461,7 @@ int skl_dsp_set_dma_control(struct skl_sst *ctx, u32 *caps,void skl_tplg_set_be_dmic_config (struct snd_soc_dai *dai,struct skl_pipe_params *params,int stream);int skl_tplg_init (struct snd_soc_component *component, -struct hdac_ext_bus *ebus); +struct hdac_bus *ebus);struct skl_module_cfg *skl_tplg_fe_get_cpr_module (struct snd_soc_dai *dai,int stream); int skl_tplg_update_pipe_params(struct device *dev,
sound/soc/intel/skylake/skl.c +80 -98
493 lines not on this page · raw message
sound/soc/intel/skylake/skl.h +3 -4
@@ -67,7 +67,7 @@ struct skl_fw_config { };struct skl { -struct hdac_ext_bus ebus; +struct hdac_bus hbus;struct pci_dev *pci;unsigned int init_done:1 ;/* delayed init status */
@@ -101,9 +101,8 @@ struct skl {struct snd_soc_acpi_mach *mach; }; -#define skl_to_ebus (s) (&(s)->ebus) -#define ebus_to_skl (sbus) \ - container_of(sbus, struct skl, sbus) +#define skl_to_bus (s) (&(s)->hbus) +#define bus_to_skl (bus) container_of(bus, struct skl, hbus)/* to pass dai dma data */ struct skl_dma_params {
Signature · 1 line
2.7.4
PATCH 3/3 ALSA: hdac: Remove usage of struct hdac_ext_driver, use hdac_driver instead
In reply to Rakesh UghrejaThis patch removes the hdac_ext_driver structure. The legacy and enhanced HDaudio capabilities can be handled in a backward-compatible way without separate definitions.
--- include/sound/hdaudio.h | 5 +++++ include/sound/hdaudio_ext.h | 17 ++--------------- sound/hda/ext/hdac_ext_bus.c | 30 ++++++++++++++---------------- sound/soc/codecs/hdac_hdmi.c | 12 +++++------- 4 files changed, 26 insertions(+), 38 deletions(-)
include/sound/hdaudio.h +5 -0
@@ -188,6 +188,11 @@ struct hdac_driver {const struct hda_device_id *id_table;int (*match)(struct hdac_device *dev,struct hdac_driver *drv);void (*unsol_event)(struct hdac_device *dev,unsigned int event); + +/* fields used by ext bus APIs */ +int (*probe)(struct hdac_device *dev); +int (*remove)(struct hdac_device *dev); +void (*shutdown)(struct hdac_device *dev); };#define drv_to_hdac_driver (_drv) container_of(_drv, struct hdac_driver, driver)
include/sound/hdaudio_ext.h +2 -15
@@ -160,20 +160,7 @@ struct hdac_ext_dma_params { u8 stream_tag; }; -/* -* HD-audio codec base driver -*/ -struct hdac_ext_driver { -struct hdac_driver hdac; - -int (*probe)(struct hdac_device *dev); -int (*remove)(struct hdac_device *dev); -void (*shutdown)(struct hdac_device *dev); -}; - -int snd_hda_ext_driver_register (struct hdac_ext_driver *drv); -void snd_hda_ext_driver_unregister (struct hdac_ext_driver *drv); - -#define to_ehdac_driver (_drv) container_of(_drv, struct hdac_ext_driver, hdac) +int snd_hda_ext_driver_register (struct hdac_driver *drv); +void snd_hda_ext_driver_unregister (struct hdac_driver *drv);#endif /* __SOUND_HDAUDIO_EXT_H */
sound/hda/ext/hdac_ext_bus.c +14 -16
@@ -200,12 +200,10 @@ EXPORT_SYMBOL_GPL(snd_hdac_ext_bus_device_remove);#define dev_to_hdac (dev) (container_of((dev), \ struct hdac_device, dev)) -static inline struct hdac_ext_driver *get_edrv (struct device *dev) +static inline struct hdac_driver *get_hdrv (struct device *dev) {struct hdac_driver *hdrv =drv_to_hdac_driver (dev->driver); -struct hdac_ext_driver *edrv =to_ehdac_driver (hdrv); - -return edrv; +return hdrv; }static inline struct hdac_device *get_hdev (struct device *dev)
@@ -216,17 +214,17 @@ static inline struct hdac_device *get_hdev(struct device *dev)static int hda_ext_drv_probe (struct device *dev) { -return (get_edrv (dev))->probe (get_hdev (dev)); +return (get_hdrv (dev))->probe (get_hdev (dev)); }static int hdac_ext_drv_remove (struct device *dev) { -return (get_edrv (dev))->remove (get_hdev (dev)); +return (get_hdrv (dev))->remove (get_hdev (dev)); }static void hdac_ext_drv_shutdown (struct device *dev) { -return (get_edrv (dev))->shutdown (get_hdev (dev)); +return (get_hdrv (dev))->shutdown (get_hdev (dev)); }/**
@@ -234,20 +232,20 @@ static void hdac_ext_drv_shutdown(struct device *dev)* * @drv: ext hda driver structure */ -int snd_hda_ext_driver_register (struct hdac_ext_driver *drv) +int snd_hda_ext_driver_register (struct hdac_driver *drv) { - drv->hdac.type =HDA_DEV_ASOC ; - drv->hdac.driver.bus = &snd_hda_bus_type; + drv->type =HDA_DEV_ASOC ; + drv->driver.bus = &snd_hda_bus_type;/* we use default match */ if (drv->probe) - drv->hdac.driver.probe = hda_ext_drv_probe; + drv->driver.probe = hda_ext_drv_probe;if (drv->remove) - drv->hdac.driver.remove = hdac_ext_drv_remove; + drv->driver.remove = hdac_ext_drv_remove;if (drv->shutdown) - drv->hdac.driver.shutdown = hdac_ext_drv_shutdown; + drv->driver.shutdown = hdac_ext_drv_shutdown; -return driver_register (&drv->hdac.driver); +return driver_register (&drv->driver); }EXPORT_SYMBOL_GPL (snd_hda_ext_driver_register);
@@ -256,8 +254,8 @@ EXPORT_SYMBOL_GPL(snd_hda_ext_driver_register);* * @drv: ext hda driver structure */ -void snd_hda_ext_driver_unregister (struct hdac_ext_driver *drv) +void snd_hda_ext_driver_unregister (struct hdac_driver *drv) { -driver_unregister (&drv->hdac.driver); +driver_unregister (&drv->driver); }EXPORT_SYMBOL_GPL (snd_hda_ext_driver_unregister);
sound/soc/codecs/hdac_hdmi.c +5 -7
@@ -2186,14 +2186,12 @@ static const struct hda_device_id hdmi_list[] = {MODULE_DEVICE_TABLE (hdaudio, hdmi_list); -static struct hdac_ext_driver hdmi_driver = { - . hdac = { - .driver = { - .name ="HDMI HDA Codec" , - .pm = &hdac_hdmi_pm, - }, - .id_table = hdmi_list, +static struct hdac_driver hdmi_driver = { + .driver = { + .name ="HDMI HDA Codec" , + .pm = &hdac_hdmi_pm, }, + .id_table = hdmi_list, .probe = hdac_hdmi_dev_probe, .remove = hdac_hdmi_dev_remove, };
Signature · 1 line
2.7.4