Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion src/drivers/intel/cavs/alh.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ static int alh_probe(struct dai *dai)
alh = rzalloc(SOF_MEM_ZONE_SYS_RUNTIME, 0, SOF_MEM_CAPS_RAM,
sizeof(*alh));
if (!alh) {
dai_err(dai, "ssp_probe() error: alloc failed");
dai_err(dai, "alh_probe() error: alloc failed");
return -ENOMEM;
}
dai_set_drvdata(dai, alh);
Expand Down
49 changes: 45 additions & 4 deletions src/drivers/intel/cavs/hda.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <sof/lib/uuid.h>
#include <ipc/dai.h>
#include <ipc/stream.h>
#include <ipc/topology.h>

/* bc9ebe20-4577-41bb-9eed-d0cb236328da */
DECLARE_SOF_UUID("hda-dai", hda_uuid, 0xbc9ebe20, 0x4577, 0x41bb,
Expand All @@ -25,22 +26,62 @@ static int hda_trigger(struct dai *dai, int cmd, int direction)
static int hda_set_config(struct dai *dai,
struct sof_ipc_dai_config *config)
{
struct hda_pdata *hda = dai_get_drvdata(dai);

if (config->hda.channels || config->hda.rate) {
hda->params.channels = config->hda.channels;
hda->params.rate = config->hda.rate;
}

return 0;
}

/* get HDA hw params */
static int hda_get_hw_params(struct dai *dai,
struct sof_ipc_stream_params *params, int dir)
{
struct hda_pdata *hda = dai_get_drvdata(dai);

params->rate = hda->params.rate;
params->channels = hda->params.channels;

/* 0 means variable */
params->rate = 0;
params->channels = 0;
params->buffer_fmt = 0;
params->frame_fmt = 0;

return 0;
}

static int hda_probe(struct dai *dai)
{
struct hda_pdata *hda;

dai_info(dai, "hda_probe()");

if (dai_get_drvdata(dai))
return -EEXIST;

hda = rzalloc(SOF_MEM_ZONE_SYS_RUNTIME, 0, SOF_MEM_CAPS_RAM,
sizeof(*hda));
if (!hda) {
dai_err(dai, "hda_probe() error: alloc failed");
return -ENOMEM;
}
dai_set_drvdata(dai, hda);

return 0;
}

static int hda_remove(struct dai *dai)
{
dai_info(dai, "hda_remove()");

rfree(dai_get_drvdata(dai));
dai_set_drvdata(dai, NULL);

return 0;
}

static int hda_dummy(struct dai *dai)
{
return 0;
Expand Down Expand Up @@ -170,8 +211,8 @@ const struct dai_driver hda_driver = {
.get_hw_params = hda_get_hw_params,
.get_handshake = hda_get_handshake,
.get_fifo = hda_get_fifo,
.probe = hda_dummy,
.remove = hda_dummy,
.probe = hda_probe,
.remove = hda_remove,
},
.ts_ops = {
.ts_config = hda_ts_config,
Expand Down
2 changes: 2 additions & 0 deletions src/include/ipc/dai-intel.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ struct sof_ipc_dai_ssp_params {
struct sof_ipc_dai_hda_params {
uint32_t reserved0;
uint32_t link_dma_ch;
uint32_t rate;
uint32_t channels;
} __attribute__((packed));

/* ALH Configuration Request - SOF_IPC_DAI_ALH_CONFIG */
Expand Down
2 changes: 1 addition & 1 deletion src/include/kernel/abi.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

/** \brief SOF ABI version major, minor and patch numbers */
#define SOF_ABI_MAJOR 3
#define SOF_ABI_MINOR 15
#define SOF_ABI_MINOR 16
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@slawblauciak Lets make this 15 so we dont need to block. I will update the ABI table.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NAK that, kernel is already merged. Will change back to 16 and others to 16.

#define SOF_ABI_PATCH 0

/** \brief SOF ABI version number. Format within 32bit word is MMmmmppp */
Expand Down
5 changes: 5 additions & 0 deletions src/include/sof/drivers/hda.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,13 @@
#ifndef __SOF_DRIVERS_HDA_H__
#define __SOF_DRIVERS_HDA_H__

#include <ipc/dai-intel.h>
#include <sof/lib/dai.h>

struct hda_pdata {
struct sof_ipc_dai_hda_params params;
};

extern const struct dai_driver hda_driver;

#endif /* __SOF_DRIVERS_HDA_H__ */