Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e3d280fc authored by Takashi Iwai's avatar Takashi Iwai
Browse files

ALSA: hda - Make snd_hda_bus_type public



Define the common hd-audio driver and device types to bind over
snd_hda_bus_type publicly.  This allows to implement other type of
device and driver code over hd-audio bus.

Now both struct hda_codec and struct hda_codec_driver inherit these
new struct hdac_device and struct hdac_driver, respectively.

The bus registration is done in subsys_initcall() to assure it
before any other driver registrations.

Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 3372dbdd
Loading
Loading
Loading
Loading
+42 −0
Original line number Diff line number Diff line
/*
 * HD-audio core stuff
 */

#ifndef __SOUND_HDAUDIO_H
#define __SOUND_HDAUDIO_H

#include <linux/device.h>

/*
 * exported bus type
 */
extern struct bus_type snd_hda_bus_type;

/*
 * HD-audio codec base device
 */
struct hdac_device {
	struct device dev;
	int type;
};

/* device/driver type used for matching */
enum {
	HDA_DEV_CORE,
	HDA_DEV_LEGACY,
};

#define dev_to_hdac_dev(_dev)	container_of(_dev, struct hdac_device, dev)

/*
 * HD-audio codec base driver
 */
struct hdac_driver {
	struct device_driver driver;
	int type;
	int (*match)(struct hdac_device *dev, struct hdac_driver *drv);
};

#define drv_to_hdac_driver(_drv) container_of(_drv, struct hdac_driver, driver)

#endif /* __SOUND_HDAUDIO_H */
+2 −0
Original line number Diff line number Diff line
@@ -76,6 +76,8 @@ source "sound/isa/Kconfig"

source "sound/pci/Kconfig"

source "sound/hda/Kconfig"

source "sound/ppc/Kconfig"

source "sound/aoa/Kconfig"
+1 −1
Original line number Diff line number Diff line
@@ -6,7 +6,7 @@ obj-$(CONFIG_SOUND_PRIME) += sound_firmware.o
obj-$(CONFIG_SOUND_PRIME) += oss/
obj-$(CONFIG_DMASOUND) += oss/
obj-$(CONFIG_SND) += core/ i2c/ drivers/ isa/ pci/ ppc/ arm/ sh/ synth/ usb/ \
	firewire/ sparc/ spi/ parisc/ pcmcia/ mips/ soc/ atmel/
	firewire/ sparc/ spi/ parisc/ pcmcia/ mips/ soc/ atmel/ hda/
obj-$(CONFIG_SND_AOA) += aoa/

# This one must be compilable even if sound is configured out

sound/hda/Kconfig

0 → 100644
+2 −0
Original line number Diff line number Diff line
config SND_HDA_CORE
	tristate

sound/hda/Makefile

0 → 100644
+3 −0
Original line number Diff line number Diff line
snd-hda-core-objs := hda_bus_type.o

obj-$(CONFIG_SND_HDA_CORE) += snd-hda-core.o
Loading