drivers: dai: modify dai_config_get API func

Modify dai_config_get function to have the config struct as argument.
This was not a showstopper but a request in the API review.

In the same patch modify all Intel dai drivers using the API to preserve
bisect/compile.

Signed-off-by: Jaska Uimonen <jaska.uimonen@linux.intel.com>
This commit is contained in:
Jaska Uimonen 2023-01-10 11:19:43 +02:00 committed by Anas Nashif
commit 3b7f9c320d
5 changed files with 48 additions and 19 deletions

View file

@ -1825,14 +1825,20 @@ static int dai_ssp_trigger(const struct device *dev, enum dai_dir dir,
return 0;
}
static const struct dai_config *dai_ssp_config_get(const struct device *dev, enum dai_dir dir)
static int dai_ssp_config_get(const struct device *dev, struct dai_config *cfg, enum dai_dir dir)
{
struct dai_config *params = (struct dai_config *)dev->config;
struct dai_intel_ssp *dp = (struct dai_intel_ssp *)dev->data;
struct dai_intel_ssp_pdata *ssp = dai_get_drvdata(dp);
if (!ssp)
return params;
if (!cfg) {
return -EINVAL;
}
if (!ssp) {
*cfg = *params;
return 0;
}
params->rate = ssp->params.fsync_rate;
@ -1844,7 +1850,9 @@ static const struct dai_config *dai_ssp_config_get(const struct device *dev, enu
params->word_size = ssp->params.sample_valid_bits;
return params;
*cfg = *params;
return 0;
}
static int dai_ssp_config_set(const struct device *dev, const struct dai_config *cfg,