devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Mathieu Dubois-Briand" <mathieu.dubois-briand@bootlin.com>
To: "Uwe Kleine-König" <ukleinek@kernel.org>
Cc: "Lee Jones" <lee@kernel.org>, "Rob Herring" <robh@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Kamel Bouhara" <kamel.bouhara@bootlin.com>,
	"Linus Walleij" <linus.walleij@linaro.org>,
	"Bartosz Golaszewski" <brgl@bgdev.pl>,
	"Dmitry Torokhov" <dmitry.torokhov@gmail.com>,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-gpio@vger.kernel.org, linux-input@vger.kernel.org,
	linux-pwm@vger.kernel.org,
	"Grégory Clement" <gregory.clement@bootlin.com>,
	"Thomas Petazzoni" <thomas.petazzoni@bootlin.com>
Subject: Re: [PATCH 4/8] pwm: max7360: Add MAX7360 PWM support
Date: Mon, 23 Dec 2024 16:26:51 +0100	[thread overview]
Message-ID: <D6J6OTNHYWN8.1PGNZILBAGCS0@bootlin.com> (raw)
In-Reply-To: <dmfnpq57n3s32o33pm7wfppr5nttdvtuthe7hf32psmykotrox@mogq35gj6rjq>

On Thu Dec 19, 2024 at 10:53 PM CET, Uwe Kleine-König wrote:
> Hello,
>
> On Thu, Dec 19, 2024 at 05:21:21PM +0100, mathieu.dubois-briand@bootlin.com wrote:
> > From: Kamel Bouhara <kamel.bouhara@bootlin.com>
> > 
> > +	int ret;
> > +
> > +	if (state->polarity != PWM_POLARITY_NORMAL)
> > +		return -EINVAL;
> > +
> > +	max7360_pwm = to_max7360_pwm(chip);
> > +	ret = regmap_write_bits(max7360_pwm->regmap, MAX7360_REG_GPIOCTRL,
> > +				MAX7360_PWM_CTRL_ENABLE(pwm->hwpwm),
> > +				MAX7360_PWM_CTRL_ENABLE(pwm->hwpwm));
> > +	if (ret) {
> > +		dev_err(&chip->dev, "failed to enable pwm-%d , error %d\n",
> > +			pwm->hwpwm, ret);
> > +		return ret;
> > +	}
> > +
> > +	do_div(duty_steps, MAX7360_PWM_PERIOD_NS);
> > +
> > +	ret = regmap_write(max7360_pwm->regmap, MAX7360_REG_PWMBASE + pwm->hwpwm,
> > +			   duty_steps >= 255 ? 255 : duty_steps);
> > +	if (ret) {
> > +		dev_err(&chip->dev,
> > +			"failed to apply pwm duty_cycle %llu on pwm-%d, error %d\n",
> > +			duty_steps, pwm->hwpwm, ret);
> > +		return ret;
> > +	}
>
> Huh, state->period isn't used at all. That is wrong for sure.
>

Yes this was definitely missing. Period is fixed by the chip, so I will
make sure the requested one is valid or return -EINVAL.

Thanks a lot for your review, I am preparing a new version of this
series that should address all your comments.

-- 
Mathieu Dubois-Briand, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com


  reply	other threads:[~2024-12-23 15:27 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-19 16:21 [PATCH 0/8] Add support for MAX7360 multifunction device Mathieu Dubois-Briand
2024-12-19 16:21 ` [PATCH 1/8] dt-bindings: Add MAX7360 MFD device Mathieu Dubois-Briand
2024-12-21 20:28   ` Krzysztof Kozlowski
2024-12-19 16:21 ` [PATCH 2/8] dt-bindings: Add MAX7360 subdevices Mathieu Dubois-Briand
2024-12-19 21:54   ` Uwe Kleine-König
2024-12-21 20:34   ` Krzysztof Kozlowski
2024-12-23 15:20     ` Mathieu Dubois-Briand
2024-12-24  9:00       ` Krzysztof Kozlowski
2024-12-24 12:10         ` Mathieu Dubois-Briand
2024-12-19 16:21 ` [PATCH 3/8] mfd: Add max7360 support mathieu.dubois-briand
2024-12-20 23:01   ` kernel test robot
2024-12-19 16:21 ` [PATCH 4/8] pwm: max7360: Add MAX7360 PWM support mathieu.dubois-briand
2024-12-19 21:53   ` Uwe Kleine-König
2024-12-23 15:26     ` Mathieu Dubois-Briand [this message]
2024-12-20  5:51   ` Uwe Kleine-König
2024-12-21 20:35   ` Krzysztof Kozlowski
2024-12-19 16:21 ` [PATCH 5/8] gpio: max7360: Add MAX7360 gpio support Mathieu Dubois-Briand
2024-12-20 15:54   ` kernel test robot
2024-12-20 16:39   ` kernel test robot
2024-12-19 16:21 ` [PATCH 6/8] input: keyboard: Add support for MAX7360 keypad Mathieu Dubois-Briand
2024-12-19 19:35   ` Dmitry Torokhov
2024-12-23 15:38     ` Mathieu Dubois-Briand
2024-12-20 17:12   ` kernel test robot
2024-12-19 16:21 ` [PATCH 7/8] input: misc: Add support for MAX7360 rotary Mathieu Dubois-Briand
2024-12-19 16:21 ` [PATCH 8/8] MAINTAINERS: Add entry on MAX7360 driver Mathieu Dubois-Briand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=D6J6OTNHYWN8.1PGNZILBAGCS0@bootlin.com \
    --to=mathieu.dubois-briand@bootlin.com \
    --cc=brgl@bgdev.pl \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=gregory.clement@bootlin.com \
    --cc=kamel.bouhara@bootlin.com \
    --cc=krzk+dt@kernel.org \
    --cc=lee@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=ukleinek@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).