Re: [PATCH v6] gpio: pca953x: Add Maxim MAX7313 PWM support

2020-08-12 Thread Miquel Raynal
Hello Uwe, Thanks for the review! Uwe Kleine-König wrote on Fri, 3 Jul 2020 16:53:13 +0200: > Hello Miquel, > > On Sun, May 03, 2020 at 12:54:53PM +0200, Miquel Raynal wrote: > > +static u8 max7313_pwm_get_intensity(struct pca953x_chip *pca_chip, > > + unsigned in

Re: [PATCH v6] gpio: pca953x: Add Maxim MAX7313 PWM support

2020-07-04 Thread Uwe Kleine-König
On Sat, Jul 04, 2020 at 02:23:09PM +0300, Andy Shevchenko wrote: > On Fri, Jul 3, 2020 at 5:53 PM Uwe Kleine-König > wrote: > > On Sun, May 03, 2020 at 12:54:53PM +0200, Miquel Raynal wrote: > > ... > > > > + ret = regmap_read(pca_chip->regmap, reg, &val); > > > + mutex_unlock(&pca_chip-

Re: [PATCH v6] gpio: pca953x: Add Maxim MAX7313 PWM support

2020-07-04 Thread Andy Shevchenko
On Fri, Jul 3, 2020 at 5:53 PM Uwe Kleine-König wrote: > On Sun, May 03, 2020 at 12:54:53PM +0200, Miquel Raynal wrote: ... > > + ret = regmap_read(pca_chip->regmap, reg, &val); > > + mutex_unlock(&pca_chip->i2c_lock); > > + if (ret < 0) { > > + dev_err(dev, "Cannot retri

Re: [PATCH v6] gpio: pca953x: Add Maxim MAX7313 PWM support

2020-07-03 Thread Uwe Kleine-König
Hello Miquel, On Sun, May 03, 2020 at 12:54:53PM +0200, Miquel Raynal wrote: > +static u8 max7313_pwm_get_intensity(struct pca953x_chip *pca_chip, > + unsigned int idx) > +{ > + struct device *dev = &pca_chip->client->dev; > + unsigned int reg, shift, val, o

Re: [PATCH v6] gpio: pca953x: Add Maxim MAX7313 PWM support

2020-06-30 Thread Miquel Raynal
Hello, Andy Shevchenko wrote on Wed, 1 Jul 2020 00:27:31 +0300: > On Tue, Jun 30, 2020 at 3:45 PM Uwe Kleine-König > wrote: > > On Tue, Jun 30, 2020 at 11:13:31AM +0200, Bartosz Golaszewski wrote: > > > I can't find anything in any of the previous threads. What was the > > > reason to not go th

Re: [PATCH v6] gpio: pca953x: Add Maxim MAX7313 PWM support

2020-06-30 Thread Andy Shevchenko
On Tue, Jun 30, 2020 at 3:45 PM Uwe Kleine-König wrote: > On Tue, Jun 30, 2020 at 11:13:31AM +0200, Bartosz Golaszewski wrote: > > I can't find anything in any of the previous threads. What was the > > reason to not go the MFD way here? > > MFD doesn't work because the different "modes" are not or

Re: [PATCH v6] gpio: pca953x: Add Maxim MAX7313 PWM support

2020-06-30 Thread Uwe Kleine-König
Hallo Bartosz, On Tue, Jun 30, 2020 at 11:13:31AM +0200, Bartosz Golaszewski wrote: > I can't find anything in any of the previous threads. What was the > reason to not go the MFD way here? MFD doesn't work because the different "modes" are not orthogonal. So this is not a single device that prov

Re: [PATCH v6] gpio: pca953x: Add Maxim MAX7313 PWM support

2020-06-30 Thread Bartosz Golaszewski
On Tue, Jun 30, 2020 at 8:58 AM Miquel Raynal wrote: > > Hi Uwe, > > Uwe Kleine-König wrote on Mon, 29 Jun > 2020 21:50:44 +0200: > > > On Mon, Jun 29, 2020 at 04:08:44PM +0200, Miquel Raynal wrote: > > > Hello Uwe, Thierry, > > > > > > Miquel Raynal wrote on Sun, 3 May 2020 > > > 12:54:53 +020

Re: [PATCH v6] gpio: pca953x: Add Maxim MAX7313 PWM support

2020-06-30 Thread Uwe Kleine-König
Hello Miquel, On Tue, Jun 30, 2020 at 08:58:28AM +0200, Miquel Raynal wrote: > Uwe Kleine-König wrote on Mon, 29 Jun > 2020 21:50:44 +0200: > > > On Mon, Jun 29, 2020 at 04:08:44PM +0200, Miquel Raynal wrote: > > > Hello Uwe, Thierry, > > > > > > Miquel Raynal wrote on Sun, 3 May 2020 > > > 1

Re: [PATCH v6] gpio: pca953x: Add Maxim MAX7313 PWM support

2020-06-29 Thread Miquel Raynal
Hi Uwe, Uwe Kleine-König wrote on Mon, 29 Jun 2020 21:50:44 +0200: > On Mon, Jun 29, 2020 at 04:08:44PM +0200, Miquel Raynal wrote: > > Hello Uwe, Thierry, > > > > Miquel Raynal wrote on Sun, 3 May 2020 > > 12:54:53 +0200: > > > > > The MAX7313 chip is fully compatible with the PCA9535 on

Re: [PATCH v6] gpio: pca953x: Add Maxim MAX7313 PWM support

2020-06-29 Thread Uwe Kleine-König
On Mon, Jun 29, 2020 at 04:08:44PM +0200, Miquel Raynal wrote: > Hello Uwe, Thierry, > > Miquel Raynal wrote on Sun, 3 May 2020 > 12:54:53 +0200: > > > The MAX7313 chip is fully compatible with the PCA9535 on its basic > > functions but can also manage the intensity on each of its ports with >

Re: [PATCH v6] gpio: pca953x: Add Maxim MAX7313 PWM support

2020-06-29 Thread Andy Shevchenko
On Mon, Jun 29, 2020 at 5:08 PM Miquel Raynal wrote: > Miquel Raynal wrote on Sun, 3 May 2020 > 12:54:53 +0200: > > > The MAX7313 chip is fully compatible with the PCA9535 on its basic > > functions but can also manage the intensity on each of its ports with > > PWM. Each output is independent a

Re: [PATCH v6] gpio: pca953x: Add Maxim MAX7313 PWM support

2020-06-29 Thread Miquel Raynal
Hello Uwe, Thierry, Miquel Raynal wrote on Sun, 3 May 2020 12:54:53 +0200: > The MAX7313 chip is fully compatible with the PCA9535 on its basic > functions but can also manage the intensity on each of its ports with > PWM. Each output is independent and may be tuned with 16 values (4 > bits per

Re: [PATCH v6] gpio: pca953x: Add Maxim MAX7313 PWM support

2020-05-03 Thread Uwe Kleine-König
Hello Andy, hello Miquel, On Sun, May 03, 2020 at 10:20:23PM +0300, Andy Shevchenko wrote: > On Sun, May 3, 2020 at 1:54 PM Miquel Raynal > wrote: > > > > The MAX7313 chip is fully compatible with the PCA9535 on its basic > > functions but can also manage the intensity on each of its ports with

Re: [PATCH v6] gpio: pca953x: Add Maxim MAX7313 PWM support

2020-05-03 Thread Andy Shevchenko
On Sun, May 3, 2020 at 1:54 PM Miquel Raynal wrote: > > The MAX7313 chip is fully compatible with the PCA9535 on its basic > functions but can also manage the intensity on each of its ports with > PWM. Each output is independent and may be tuned with 16 values (4 > bits per output). The period is

[PATCH v6] gpio: pca953x: Add Maxim MAX7313 PWM support

2020-05-03 Thread Miquel Raynal
The MAX7313 chip is fully compatible with the PCA9535 on its basic functions but can also manage the intensity on each of its ports with PWM. Each output is independent and may be tuned with 16 values (4 bits per output). The period is always 32kHz, only the duty-cycle may be changed. One can use a