Openbmc archive mirror
 help / color / mirror / Atom feed
From: Tomer Maimon <tmaimon77@gmail.com>
To: Guenter Roeck <linux@roeck-us.net>
Cc: linux-hwmon@vger.kernel.org, jdelvare@suse.com,
	benjaminfair@google.com, avifishman70@gmail.com,
	venture@google.com, openbmc@lists.ozlabs.org,
	j.neuschaefer@gmx.net, tali.perry1@gmail.com, joel@jms.id.au,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 1/1] hwmon: npcm750-pwm-fan: Add NPCM8xx support
Date: Tue, 31 Oct 2023 09:54:03 +0200	[thread overview]
Message-ID: <CAP6Zq1hEFN==n3Um6MCvR-MqPERxwrm8Qd0DrKudA6L4xynDZA@mail.gmail.com> (raw)
In-Reply-To: <e3de2c1f-3a05-4ffc-a50e-0b5522cf7740@roeck-us.net>

Hi Guenter,

Thanks for your comments

On Mon, 30 Oct 2023 at 17:57, Guenter Roeck <linux@roeck-us.net> wrote:
>
> On 10/30/23 08:01, Tomer Maimon wrote:
> > Adding Pulse Width Modulation (PWM) and fan tacho NPCM8xx support to
> > NPCM PWM and fan tacho driver.
> > NPCM8xx uses a different number of PWM devices.
> >
> > As part of adding NPCM8XX support:
> > - Add NPCM8xx specific compatible string.
> > - Add data to handle architecture-specific PWM and fan tacho parameters.
> >
> > Signed-off-by: Tomer Maimon <tmaimon77@gmail.com>
> > ---
> >   drivers/hwmon/npcm750-pwm-fan.c | 34 +++++++++++++++++++++++++++++----
> >   1 file changed, 30 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/hwmon/npcm750-pwm-fan.c b/drivers/hwmon/npcm750-pwm-fan.c
> > index 10ed3f4335d4..765b08fa0396 100644
> > --- a/drivers/hwmon/npcm750-pwm-fan.c
> > +++ b/drivers/hwmon/npcm750-pwm-fan.c
> > @@ -46,9 +46,9 @@
> >   #define NPCM7XX_PWM_CTRL_CH3_EN_BIT         BIT(16)
> >
> >   /* Define the maximum PWM channel number */
> > -#define NPCM7XX_PWM_MAX_CHN_NUM                      8
> > +#define NPCM7XX_PWM_MAX_CHN_NUM                      12
> >   #define NPCM7XX_PWM_MAX_CHN_NUM_IN_A_MODULE 4
> > -#define NPCM7XX_PWM_MAX_MODULES                 2
> > +#define NPCM7XX_PWM_MAX_MODULES                 3
> >
> >   /* Define the Counter Register, value = 100 for match 100% */
> >   #define NPCM7XX_PWM_COUNTER_DEFAULT_NUM             255
> > @@ -171,6 +171,10 @@
> >   #define FAN_PREPARE_TO_GET_FIRST_CAPTURE    0x01
> >   #define FAN_ENOUGH_SAMPLE                   0x02
> >
> > +struct npcm_hwmon_info {
> > +     u32 pwm_max_channel;
> > +};
> > +
> >   struct npcm7xx_fan_dev {
> >       u8 fan_st_flg;
> >       u8 fan_pls_per_rev;
> > @@ -204,6 +208,7 @@ struct npcm7xx_pwm_fan_data {
> >       struct timer_list fan_timer;
> >       struct npcm7xx_fan_dev fan_dev[NPCM7XX_FAN_MAX_CHN_NUM];
> >       struct npcm7xx_cooling_device *cdev[NPCM7XX_PWM_MAX_CHN_NUM];
> > +     const struct npcm_hwmon_info *info;
> >       u8 fan_select;
> >   };
> >
> > @@ -619,9 +624,13 @@ static umode_t npcm7xx_is_visible(const void *data,
> >                                 enum hwmon_sensor_types type,
> >                                 u32 attr, int channel)
> >   {
> > +     const struct npcm7xx_pwm_fan_data *hwmon_data = data;
> > +
> >       switch (type) {
> >       case hwmon_pwm:
> > -             return npcm7xx_pwm_is_visible(data, attr, channel);
> > +             if (channel < hwmon_data->info->pwm_max_channel)
> > +                     return npcm7xx_pwm_is_visible(data, attr, channel);
>
> I would have expected this check to be handled in npcm7xx_pwm_is_visible().
I will change the handle in npcm7xx_pwm_is_visible
>
> Guenter
>

Thanks,

Tomer

      reply	other threads:[~2023-10-31  7:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-30 15:01 [PATCH v3 0/1] hwmon: npcm: add Arbel NPCM8XX support Tomer Maimon
2023-10-30 15:01 ` [PATCH v3 1/1] hwmon: npcm750-pwm-fan: Add NPCM8xx support Tomer Maimon
2023-10-30 15:55   ` Guenter Roeck
2023-10-30 15:57   ` Guenter Roeck
2023-10-31  7:54     ` Tomer Maimon [this message]

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='CAP6Zq1hEFN==n3Um6MCvR-MqPERxwrm8Qd0DrKudA6L4xynDZA@mail.gmail.com' \
    --to=tmaimon77@gmail.com \
    --cc=avifishman70@gmail.com \
    --cc=benjaminfair@google.com \
    --cc=j.neuschaefer@gmx.net \
    --cc=jdelvare@suse.com \
    --cc=joel@jms.id.au \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=openbmc@lists.ozlabs.org \
    --cc=tali.perry1@gmail.com \
    --cc=venture@google.com \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).