lkml.org 
[lkml]   [2022]   [Aug]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/1] drivers: Add kcontrol
On Fri, Aug 12, 2022 at 11:18:16AM +0800, Kevin Lu wrote:
> Add a new kcontrol for phase calib
>
> Signed-off-by: Kevin Lu <luminlong@139.com>

Please submit patches using subject lines reflecting the style for the
subsystem, this makes it easier for people to identify relevant patches.
Look at what existing commits in the area you're changing are doing and
make sure your subject lines visually resemble what they're doing.
There's no need to resubmit to fix this alone.

> +static const char * const phase_calib_switch[] = {
> + "Disable",
> + "Enable"
> +};
> +
> +static const struct soc_enum phase_calib_enum[] = {
> + SOC_ENUM_SINGLE_EXT(ARRAY_SIZE(phase_calib_switch), phase_calib_switch),
> +};

To repeat this is a simple on/off control and should be a normal Switch,
not an enum.

> +static int adcx140_phase_calib_get(struct snd_kcontrol *Kcontrol,
> + struct snd_ctl_elem_value *Value)

*Please* follow the kernel coding style for variable names. It's good
that you've taken out the hungarian notation but the caps are also bad.

> +static int adcx140_phase_calib_put(struct snd_kcontrol *Kcontrol,
> + struct snd_ctl_elem_value *Value)
> +{
> + struct snd_soc_component *codec
> + = snd_soc_kcontrol_component(Kcontrol);
> + struct adcx140_priv *adcx140 = snd_soc_component_get_drvdata(codec);
> +
> + adcx140->phase_calib_on = Value->value.integer.value[0] ? true : false;
> +
> + return 0;
> +}

To repeat my previous comments:

| This should return 1 if the value changes, the mixer-test selftest will
| check for this and a number of other issues - you should ensure your
| driver passes that cleanly.

Please don't ignore review comments, people are generally making them
for a reason and are likely to have the same concerns if issues remain
unaddressed. Having to repeat the same comments can get repetitive and
make people question the value of time spent reviewing. If you disagree
with the review comments that's fine but you need to reply and discuss
your concerns so that the reviewer can understand your decisions.
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2022-08-12 14:14    [W:0.050 / U:0.632 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site