Message ID | 1571295929-47286-20-git-send-email-biju.das@bp.renesas.com (mailing list archive) |
---|---|
State | Changes Requested |
Headers | show |
Series | Audio improvements/SSIU BUSIF/ | expand |
On Thu 2019-10-17 08:04:51, Biju Das wrote: > From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> > > commit 82ab7e9a4d3fcec27f745be04063e17da1881dda upstream. > > commit fb2815f44a9e ("ASoC: rsnd: add support for 16/24 bit slot widths") > added TDM width check, and return error if it was not 16/24/32 bit. > But it is too strict. This patch uses 32bit same as default. > @@ -738,8 +738,8 @@ static int rsnd_soc_set_dai_tdm_slot(struct snd_soc_dai *dai, > case 32: > break; > default: > - dev_err(dev, "unsupported slot width value: %d\n", slot_width); > - return -EINVAL; > + /* use default */ > + slot_width = 32; > } > > switch (slots) { I don't think I like this. People should not be passing strange values to this function. Can the caller be fixed, instead? Thanks, Pavel
+ Morimoto-San, Hi Pavel, Thanks for the feedback. > -----Original Message----- > From: Pavel Machek <pavel@denx.de> > Sent: Sunday, October 20, 2019 10:49 AM > To: Biju Das <biju.das@bp.renesas.com> > Cc: cip-dev@lists.cip-project.org; Nobuhiro Iwamatsu > <nobuhiro1.iwamatsu@toshiba.co.jp>; Pavel Machek <pavel@denx.de>; > Chris Paterson <Chris.Paterson2@renesas.com>; Fabrizio Castro > <fabrizio.castro@bp.renesas.com> > Subject: Re: [PATCH 4.19.y-cip 19/57] ASoC: rsnd: use 32bit TDM width as > default > > On Thu 2019-10-17 08:04:51, Biju Das wrote: > > From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> > > > > commit 82ab7e9a4d3fcec27f745be04063e17da1881dda upstream. > > > > commit fb2815f44a9e ("ASoC: rsnd: add support for 16/24 bit slot > > widths") added TDM width check, and return error if it was not 16/24/32 > bit. > > But it is too strict. This patch uses 32bit same as default. > > > @@ -738,8 +738,8 @@ static int rsnd_soc_set_dai_tdm_slot(struct > snd_soc_dai *dai, > > case 32: > > break; > > default: > > - dev_err(dev, "unsupported slot width value: %d\n", > slot_width); > > - return -EINVAL; > > + /* use default */ > > + slot_width = 32; > > } > > > > switch (slots) { > > I don't think I like this. People should not be passing strange values to this > function. Can the caller be fixed, instead? Morimoto San, Do you agree to Pavel's comment? Regards, Biju
Hi > > > @@ -738,8 +738,8 @@ static int rsnd_soc_set_dai_tdm_slot(struct snd_soc_dai *dai, > > > case 32: > > > break; > > > default: > > > - dev_err(dev, "unsupported slot width value: %d\n", slot_width); > > > - return -EINVAL; > > > + /* use default */ > > > + slot_width = 32; > > > } > > > > > > switch (slots) { > > > > I don't think I like this. People should not be passing strange values to this > > function. Can the caller be fixed, instead? > > Morimoto San, Do you agree to Pavel's comment? As git-log said, it is default values, not strange value. People don't set all settings, especially it was default. Thank you for your help !! Best regards --- Kuninori Morimoto
On Wed 2019-10-23 10:45:18, Kuninori Morimoto wrote: > > Hi > > > > > @@ -738,8 +738,8 @@ static int rsnd_soc_set_dai_tdm_slot(struct snd_soc_dai *dai, > > > > case 32: > > > > break; > > > > default: > > > > - dev_err(dev, "unsupported slot width value: %d\n", slot_width); > > > > - return -EINVAL; > > > > + /* use default */ > > > > + slot_width = 32; > > > > } > > > > > > > > switch (slots) { > > > > > > I don't think I like this. People should not be passing strange values to this > > > function. Can the caller be fixed, instead? > > > > Morimoto San, Do you agree to Pavel's comment? > > As git-log said, it is default values, not strange value. > People don't set all settings, especially it was default. I'd understand turning 0 to 32 (that is if someone forgot to set it?). But turning 19 into 32 seems wrong. Best regards, Pavel
Hi Pavel > > > > > @@ -738,8 +738,8 @@ static int rsnd_soc_set_dai_tdm_slot(struct snd_soc_dai *dai, > > > > > case 32: > > > > > break; > > > > > default: > > > > > - dev_err(dev, "unsupported slot width value: %d\n", slot_width); > > > > > - return -EINVAL; > > > > > + /* use default */ > > > > > + slot_width = 32; > > > > > } > > > > > > > > > > switch (slots) { > > > > > > > > I don't think I like this. People should not be passing strange values to this > > > > function. Can the caller be fixed, instead? > > > > > > Morimoto San, Do you agree to Pavel's comment? > > > > As git-log said, it is default values, not strange value. > > People don't set all settings, especially it was default. > > I'd understand turning 0 to 32 (that is if someone forgot to set > it?). But turning 19 into 32 seems wrong. Hmm... indeed. But 19 (in this case) is wrong settings. So, can you accept like this ? switch (slot_width) { ... default: /* use default */ => if (slot_width) => dev_warn(dev, "unsupported slot width(%d). use default\n", slot_width); slot_width = 32; } Thank you for your help !! Best regards --- Kuninori Morimoto
diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c index fd41da7..4a2a48e 100644 --- a/sound/soc/sh/rcar/core.c +++ b/sound/soc/sh/rcar/core.c @@ -738,8 +738,8 @@ static int rsnd_soc_set_dai_tdm_slot(struct snd_soc_dai *dai, case 32: break; default: - dev_err(dev, "unsupported slot width value: %d\n", slot_width); - return -EINVAL; + /* use default */ + slot_width = 32; } switch (slots) {