Re: [PATCH v2 1/2] ASoC: codecs: Add support for PCM1789

2018-03-07 Thread Mylène Josserand
Hello Mark,

Thanks for the review.

On Mon, 5 Mar 2018 15:59:38 +
Mark Brown  wrote:

> On Mon, Mar 05, 2018 at 04:57:15PM +0100, Alexandre Belloni wrote:
> > On 05/03/2018 at 15:49:10 +, Mark Brown wrote:  
> 
> > > Please don't mix C and C++ style comments in a single comment like this
> > > - it looks unintentional.  Just use the same style for the whole thing.
> > > You also don't need to include all the boilerplate with the SPDX header.  
> 
> > I think Linus made it clear that he wants the SPDX header to be a
> > C++ comment, the documentation has:  
> 
> Sure, so make the entire thing a C++ comment then.

Ok, I saw other drivers with this mix C++/C comment code so I wrote it
like this but no problem using only C++ comment.

I will send a v3 with this modification only (except if I have other
reviews).

Best regards,

-- 
Mylène Josserand, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
http://bootlin.com


Re: [PATCH v2 1/2] ASoC: codecs: Add support for PCM1789

2018-03-07 Thread Mylène Josserand
Hello Mark,

Thanks for the review.

On Mon, 5 Mar 2018 15:59:38 +
Mark Brown  wrote:

> On Mon, Mar 05, 2018 at 04:57:15PM +0100, Alexandre Belloni wrote:
> > On 05/03/2018 at 15:49:10 +, Mark Brown wrote:  
> 
> > > Please don't mix C and C++ style comments in a single comment like this
> > > - it looks unintentional.  Just use the same style for the whole thing.
> > > You also don't need to include all the boilerplate with the SPDX header.  
> 
> > I think Linus made it clear that he wants the SPDX header to be a
> > C++ comment, the documentation has:  
> 
> Sure, so make the entire thing a C++ comment then.

Ok, I saw other drivers with this mix C++/C comment code so I wrote it
like this but no problem using only C++ comment.

I will send a v3 with this modification only (except if I have other
reviews).

Best regards,

-- 
Mylène Josserand, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
http://bootlin.com


Re: [PATCH v2 1/2] ASoC: codecs: Add support for PCM1789

2018-03-05 Thread Mark Brown
On Mon, Mar 05, 2018 at 04:57:15PM +0100, Alexandre Belloni wrote:
> On 05/03/2018 at 15:49:10 +, Mark Brown wrote:

> > Please don't mix C and C++ style comments in a single comment like this
> > - it looks unintentional.  Just use the same style for the whole thing.
> > You also don't need to include all the boilerplate with the SPDX header.

> I think Linus made it clear that he wants the SPDX header to be a
> C++ comment, the documentation has:

Sure, so make the entire thing a C++ comment then.


signature.asc
Description: PGP signature


Re: [PATCH v2 1/2] ASoC: codecs: Add support for PCM1789

2018-03-05 Thread Mark Brown
On Mon, Mar 05, 2018 at 04:57:15PM +0100, Alexandre Belloni wrote:
> On 05/03/2018 at 15:49:10 +, Mark Brown wrote:

> > Please don't mix C and C++ style comments in a single comment like this
> > - it looks unintentional.  Just use the same style for the whole thing.
> > You also don't need to include all the boilerplate with the SPDX header.

> I think Linus made it clear that he wants the SPDX header to be a
> C++ comment, the documentation has:

Sure, so make the entire thing a C++ comment then.


signature.asc
Description: PGP signature


Re: [PATCH v2 1/2] ASoC: codecs: Add support for PCM1789

2018-03-05 Thread Alexandre Belloni
On 05/03/2018 at 15:49:10 +, Mark Brown wrote:
> On Mon, Mar 05, 2018 at 01:48:16PM +0100, Mylène Josserand wrote:
> 
> > --- /dev/null
> > +++ b/sound/soc/codecs/pcm1789-i2c.c
> > @@ -0,0 +1,76 @@
> > +// SPDX-License-Identifier: GPL-2.0
> > +/*
> > + * PCM1789 ASoC I2C driver
> > + *
> > + * Copyright (c) Bootlin 2018
> > + *
> > + * Mylène Josserand 
> > + *
> > + * This program is free software; you can redistribute it and/or
> > + * modify it under the terms of the GNU General Public License
> 
> Please don't mix C and C++ style comments in a single comment like this
> - it looks unintentional.  Just use the same style for the whole thing.
> You also don't need to include all the boilerplate with the SPDX header.
> 

I think Linus made it clear that he wants the SPDX header to be a
C++ comment, the documentation has:

"
2. Style:

   The SPDX license identifier is added in form of a comment.  The comment
   style depends on the file type::

  C source: // SPDX-License-Identifier: 
"

I agree the boilerplate should be removed.


-- 
Alexandre Belloni, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com


Re: [PATCH v2 1/2] ASoC: codecs: Add support for PCM1789

2018-03-05 Thread Alexandre Belloni
On 05/03/2018 at 15:49:10 +, Mark Brown wrote:
> On Mon, Mar 05, 2018 at 01:48:16PM +0100, Mylène Josserand wrote:
> 
> > --- /dev/null
> > +++ b/sound/soc/codecs/pcm1789-i2c.c
> > @@ -0,0 +1,76 @@
> > +// SPDX-License-Identifier: GPL-2.0
> > +/*
> > + * PCM1789 ASoC I2C driver
> > + *
> > + * Copyright (c) Bootlin 2018
> > + *
> > + * Mylène Josserand 
> > + *
> > + * This program is free software; you can redistribute it and/or
> > + * modify it under the terms of the GNU General Public License
> 
> Please don't mix C and C++ style comments in a single comment like this
> - it looks unintentional.  Just use the same style for the whole thing.
> You also don't need to include all the boilerplate with the SPDX header.
> 

I think Linus made it clear that he wants the SPDX header to be a
C++ comment, the documentation has:

"
2. Style:

   The SPDX license identifier is added in form of a comment.  The comment
   style depends on the file type::

  C source: // SPDX-License-Identifier: 
"

I agree the boilerplate should be removed.


-- 
Alexandre Belloni, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com


Re: [PATCH v2 1/2] ASoC: codecs: Add support for PCM1789

2018-03-05 Thread Mark Brown
On Mon, Mar 05, 2018 at 01:48:16PM +0100, Mylène Josserand wrote:

> --- /dev/null
> +++ b/sound/soc/codecs/pcm1789-i2c.c
> @@ -0,0 +1,76 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * PCM1789 ASoC I2C driver
> + *
> + * Copyright (c) Bootlin 2018
> + *
> + * Mylène Josserand 
> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License

Please don't mix C and C++ style comments in a single comment like this
- it looks unintentional.  Just use the same style for the whole thing.
You also don't need to include all the boilerplate with the SPDX header.

> +static bool pcm1789_accessible_reg(struct device *dev, unsigned int reg)
> +{
> + return reg >= PCM1789_MUTE_CONTROL && reg <= PCM1789_DAC_VOL_RIGHT;
> +}
> +
> +static bool pcm1789_writeable_reg(struct device *dev, unsigned int reg)
> +{
> + return pcm1789_accessible_reg(dev, reg);
> +}

> +static void pcm1789_work_queue(struct work_struct *work)
> +{
> + struct pcm1789_private *priv = container_of(work,
> + struct pcm1789_private,
> + work);
> +
> + /* Perform a software reset to remove codec from desynchronized state */
> + if (regmap_update_bits(priv->regmap, PCM1789_MUTE_CONTROL,
> +0x3 << PCM1789_MUTE_SRET, 0) < 0)
> + dev_err(priv->dev, "Error while setting SRET");
> +}

A reset sounds like we'd also need to resync the register map,
presumably this is something else?  The comment could be clearer.


signature.asc
Description: PGP signature


Re: [PATCH v2 1/2] ASoC: codecs: Add support for PCM1789

2018-03-05 Thread Mark Brown
On Mon, Mar 05, 2018 at 01:48:16PM +0100, Mylène Josserand wrote:

> --- /dev/null
> +++ b/sound/soc/codecs/pcm1789-i2c.c
> @@ -0,0 +1,76 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * PCM1789 ASoC I2C driver
> + *
> + * Copyright (c) Bootlin 2018
> + *
> + * Mylène Josserand 
> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License

Please don't mix C and C++ style comments in a single comment like this
- it looks unintentional.  Just use the same style for the whole thing.
You also don't need to include all the boilerplate with the SPDX header.

> +static bool pcm1789_accessible_reg(struct device *dev, unsigned int reg)
> +{
> + return reg >= PCM1789_MUTE_CONTROL && reg <= PCM1789_DAC_VOL_RIGHT;
> +}
> +
> +static bool pcm1789_writeable_reg(struct device *dev, unsigned int reg)
> +{
> + return pcm1789_accessible_reg(dev, reg);
> +}

> +static void pcm1789_work_queue(struct work_struct *work)
> +{
> + struct pcm1789_private *priv = container_of(work,
> + struct pcm1789_private,
> + work);
> +
> + /* Perform a software reset to remove codec from desynchronized state */
> + if (regmap_update_bits(priv->regmap, PCM1789_MUTE_CONTROL,
> +0x3 << PCM1789_MUTE_SRET, 0) < 0)
> + dev_err(priv->dev, "Error while setting SRET");
> +}

A reset sounds like we'd also need to resync the register map,
presumably this is something else?  The comment could be clearer.


signature.asc
Description: PGP signature