Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
d930626
ALSA: hdac: ext: add wait for codec to respond after link reset
rakeshughreja Jul 20, 2018
5287738
ALSA: hdac: Remove usage of struct hdac_ext_device and use hdac_devic…
rakeshughreja Jul 20, 2018
de64597
ALSA: hdac: Remove usage of struct hdac_ext_bus and use hdac_bus instead
rakeshughreja Jul 20, 2018
a8b18e0
ALSA: hdac: Remove usage of struct hdac_ext_driver, use hdac_driver i…
rakeshughreja Jul 20, 2018
c45d5dd
ALSA: hda: split snd_hda_codec_new function
rakeshughreja Jul 20, 2018
dce37cc
ALSA: hdac: remove memory allocation from snd_hdac_ext_bus_device_init
rakeshughreja Jul 20, 2018
6d3b6f3
ALSA: hdac: add extended ops in the hdac_bus
rakeshughreja Jul 20, 2018
ffde851
ASoC: Intel: Boards: Machine driver for SKL+ w/ HDAudio codecs
rakeshughreja Jul 20, 2018
d0b2ca0
ASoC: Intel: Skylake: Add entry in sst_acpi_mach for HDA codecs
rakeshughreja Jul 20, 2018
e950ec5
ASoC: Intel: Skylake: add HDA BE DAIs
rakeshughreja Jul 20, 2018
b56c360
ASoC: Intel: Skylake: use hda_bus instead of hdac_bus
rakeshughreja Jul 20, 2018
4292b05
ASoC: hdac_hda: add asoc extension for legacy HDA codec drivers
rakeshughreja Jul 20, 2018
b368a81
ASoC: Intel: Skylake: fix widget handling
rakeshughreja Jul 20, 2018
d20de12
ASoC: Intel: Kconfig: make HDA_DSP_GENERIC_MACH possible for SOF
keyonjie Jul 20, 2018
c404384
ASoC: SOF: add hda_bus to snd_sof_dev struct to handle hda with sof
keyonjie Jul 20, 2018
82b3d20
ASoC: SOF: hda-stream: add CORB/RIRB ringbuffers init for HDA.
keyonjie Jul 20, 2018
7d69f41
ASoC: SOF: hda: add hda probing during initialization.
keyonjie Jul 20, 2018
352ca49
ASoC: Intel: bxt-tdf8532: add iDisp BE dai_links.
keyonjie Jul 20, 2018
b6c5d15
ASoC: SOF: HDAC: Consolidated code and removed duplication.
lrgirdwo Jul 20, 2018
f0e1f9b
ASoC: SOF: refine Kconfig for SOF HDA.
keyonjie Jul 23, 2018
642a02a
ASoC: SOF: hda: enable IRQ before codec probing
keyonjie Jul 23, 2018
2189fa7
ASoC: SOF: use hdac_bus to manage streams
mengdonglin Jul 24, 2018
d1c671e
ASoC: SOF: Replace sof_intel_hda_stream with hdac_ext_stream
mengdonglin Jul 24, 2018
7cc5deb
ASoC: SOF: hda: initial bus pointer for stream to fix a NULL pointer …
keyonjie Jul 24, 2018
3ea24e9
ASoC: SOF: hda: refine makefile for with/without HDA support
keyonjie Jul 25, 2018
bd37bda
ASoC: SOF: hda: refine to support both with/without HDA links.
keyonjie Jul 25, 2018
2f7d85a
Merge pull request #47 from keyonjie/sof-hda
lgirdwood Jul 30, 2018
2c6f4b7
ASoC: SOF: Define sof_create_audio_device
mengdonglin Jul 25, 2018
d43d4c6
ASoC: SOF: Not download firmware for legacy HDA mode
mengdonglin Aug 1, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions include/sound/hdaudio.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -208,6 +213,14 @@ struct hdac_bus_ops {
int (*link_power)(struct hdac_bus *bus, bool enable);
};

/*
* ops used for ASoC HDA codec drivers
*/
struct hdac_ext_bus_ops {
int (*hdev_attach)(struct hdac_device *hdev);
int (*hdev_detach)(struct hdac_device *hdev);
};

/*
* Lowlevel I/O operators
*/
Expand Down Expand Up @@ -250,11 +263,17 @@ 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;
const struct hdac_bus_ops *ops;
const struct hdac_io_ops *io_ops;
const struct hdac_ext_bus_ops *ext_ops;

/* h/w resources */
unsigned long addr;
Expand Down Expand Up @@ -317,6 +336,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,
Expand Down
123 changes: 29 additions & 94 deletions include/sound/hdaudio_ext.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,38 +4,16 @@

#include <sound/hdaudio.h>

/**
* hdac_ext_bus: HDAC extended bus for extended HDA caps
*
* @bus: hdac bus
* @num_streams: streams supported
* @hlink_list: link list of HDA links
* @lock: lock for link mgmt
* @cmd_dma_state: state of cmd DMAs: CORB and RIRB
*/
struct hdac_ext_bus {
struct hdac_bus bus;
int num_streams;
int idx;

struct list_head hlink_list;

struct mutex lock;
bool cmd_dma_state;
};

int snd_hdac_ext_bus_init(struct hdac_ext_bus *sbus, 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);
const struct hdac_io_ops *io_ops,
const struct hdac_ext_bus_ops *ext_ops);

void snd_hdac_ext_bus_exit(struct hdac_ext_bus *sbus);
int snd_hdac_ext_bus_device_init(struct hdac_ext_bus *sbus, int addr);
void snd_hdac_ext_bus_exit(struct hdac_bus *bus);
int snd_hdac_ext_bus_device_init(struct hdac_bus *bus, int addr,
struct hdac_device *hdev);
void snd_hdac_ext_bus_device_exit(struct hdac_device *hdev);
void snd_hdac_ext_bus_device_remove(struct hdac_ext_bus *ebus);

#define ebus_to_hbus(ebus) (&(ebus)->bus)
#define hbus_to_ebus(_bus) \
container_of(_bus, struct hdac_ext_bus, bus)
void snd_hdac_ext_bus_device_remove(struct hdac_bus *bus);

#define HDA_CODEC_REV_EXT_ENTRY(_vid, _rev, _name, drv_data) \
{ .vendor_id = (_vid), .rev_id = (_rev), .name = (_name), \
Expand All @@ -44,14 +22,14 @@ void snd_hdac_ext_bus_device_remove(struct hdac_ext_bus *ebus);
#define HDA_CODEC_EXT_ENTRY(_vid, _revid, _name, _drv_data) \
HDA_CODEC_REV_EXT_ENTRY(_vid, _revid, _name, _drv_data)

void snd_hdac_ext_bus_ppcap_enable(struct hdac_ext_bus *chip, bool enable);
void snd_hdac_ext_bus_ppcap_int_enable(struct hdac_ext_bus *chip, bool enable);
void snd_hdac_ext_bus_ppcap_enable(struct hdac_bus *chip, bool enable);
void snd_hdac_ext_bus_ppcap_int_enable(struct hdac_bus *chip, bool enable);

void snd_hdac_ext_stream_spbcap_enable(struct hdac_ext_bus *chip,
void snd_hdac_ext_stream_spbcap_enable(struct hdac_bus *chip,
bool enable, int index);

int snd_hdac_ext_bus_get_ml_capabilities(struct hdac_ext_bus *bus);
struct hdac_ext_link *snd_hdac_ext_bus_get_link(struct hdac_ext_bus *bus,
int snd_hdac_ext_bus_get_ml_capabilities(struct hdac_bus *bus);
struct hdac_ext_link *snd_hdac_ext_bus_get_link(struct hdac_bus *bus,
const char *codec_name);

enum hdac_ext_stream_type {
Expand Down Expand Up @@ -100,28 +78,28 @@ struct hdac_ext_stream {
#define stream_to_hdac_ext_stream(s) \
container_of(s, struct hdac_ext_stream, hstream)

void snd_hdac_ext_stream_init(struct hdac_ext_bus *bus,
void snd_hdac_ext_stream_init(struct hdac_bus *bus,
struct hdac_ext_stream *stream, int idx,
int direction, int tag);
int snd_hdac_ext_stream_init_all(struct hdac_ext_bus *ebus, int start_idx,
int snd_hdac_ext_stream_init_all(struct hdac_bus *bus, int start_idx,
int num_stream, int dir);
void snd_hdac_stream_free_all(struct hdac_ext_bus *ebus);
void snd_hdac_link_free_all(struct hdac_ext_bus *ebus);
struct hdac_ext_stream *snd_hdac_ext_stream_assign(struct hdac_ext_bus *bus,
void snd_hdac_stream_free_all(struct hdac_bus *bus);
void snd_hdac_link_free_all(struct hdac_bus *bus);
struct hdac_ext_stream *snd_hdac_ext_stream_assign(struct hdac_bus *bus,
struct snd_pcm_substream *substream,
int type);
void snd_hdac_ext_stream_release(struct hdac_ext_stream *azx_dev, int type);
void snd_hdac_ext_stream_decouple(struct hdac_ext_bus *bus,
void snd_hdac_ext_stream_decouple(struct hdac_bus *bus,
struct hdac_ext_stream *azx_dev, bool decouple);
void snd_hdac_ext_stop_streams(struct hdac_ext_bus *sbus);
void snd_hdac_ext_stop_streams(struct hdac_bus *bus);

int snd_hdac_ext_stream_set_spib(struct hdac_ext_bus *ebus,
int snd_hdac_ext_stream_set_spib(struct hdac_bus *bus,
struct hdac_ext_stream *stream, u32 value);
int snd_hdac_ext_stream_get_spbmaxfifo(struct hdac_ext_bus *ebus,
int snd_hdac_ext_stream_get_spbmaxfifo(struct hdac_bus *bus,
struct hdac_ext_stream *stream);
void snd_hdac_ext_stream_drsm_enable(struct hdac_ext_bus *ebus,
void snd_hdac_ext_stream_drsm_enable(struct hdac_bus *bus,
bool enable, int index);
int snd_hdac_ext_stream_set_dpibr(struct hdac_ext_bus *ebus,
int snd_hdac_ext_stream_set_dpibr(struct hdac_bus *bus,
struct hdac_ext_stream *stream, u32 value);
int snd_hdac_ext_stream_set_lpib(struct hdac_ext_stream *stream, u32 value);

Expand All @@ -144,17 +122,15 @@ struct hdac_ext_link {

int snd_hdac_ext_bus_link_power_up(struct hdac_ext_link *link);
int snd_hdac_ext_bus_link_power_down(struct hdac_ext_link *link);
int snd_hdac_ext_bus_link_power_up_all(struct hdac_ext_bus *ebus);
int snd_hdac_ext_bus_link_power_down_all(struct hdac_ext_bus *ebus);
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);
void snd_hdac_ext_link_set_stream_id(struct hdac_ext_link *link,
int stream);
void snd_hdac_ext_link_clear_stream_id(struct hdac_ext_link *link,
int stream);

int snd_hdac_ext_bus_link_get(struct hdac_ext_bus *ebus,
struct hdac_ext_link *link);
int snd_hdac_ext_bus_link_put(struct hdac_ext_bus *ebus,
struct hdac_ext_link *link);
int snd_hdac_ext_bus_link_get(struct hdac_bus *bus, struct hdac_ext_link *link);
int snd_hdac_ext_bus_link_put(struct hdac_bus *bus, struct hdac_ext_link *link);

/* update register macro */
#define snd_hdac_updatel(addr, reg, mask, val) \
Expand All @@ -181,53 +157,12 @@ 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 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 */
Loading