[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAM+2Eu+xzAPEwCoGsjM5sqKjOiT5J_-dzpeB-r5XP=KoRkSXGg@mail.gmail.com>
Date: Thu, 8 Sep 2022 01:07:28 +0530
From: Jagath Jog J <jagathjog1996@...il.com>
To: Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>
Cc: alexandre.belloni@...tlin.com, a.zummo@...ertech.it,
robh+dt@...nel.org, krzysztof.kozlowski+dt@...aro.org,
linux-rtc@...r.kernel.org, linux-kernel@...r.kernel.org,
devicetree@...r.kernel.org
Subject: Re: [PATCH v1 2/2] rtc: maxim: Add Maxim max31329 real time clock.
Hi Krzysztof.
Thank you for reviewing.
On Mon, Sep 5, 2022 at 8:50 PM Krzysztof Kozlowski
<krzysztof.kozlowski@...aro.org> wrote:
>
> On 04/09/2022 06:47, Jagath Jog J wrote:
> > Add real time clock support for Maxim max31329 real time clock.
> >
> > Signed-off-by: Jagath Jog J <jagathjog1996@...il.com>
>
> Thank you for your patch. There is something to discuss/improve.
>
> > + max31329->rtc->ops = &max31329_rtc_ops;
> > + max31329->irq = client->irq;
> > + max31329->rtc->range_min = RTC_TIMESTAMP_BEGIN_2000;
> > + max31329->rtc->range_max = RTC_TIMESTAMP_END_2199;
> > + max31329->dev = &client->dev;
> > +
> > + if (max31329->irq) {
> > + ret = devm_request_threaded_irq(&client->dev, max31329->irq,
> > + NULL, max31329_irq_handler,
> > + IRQF_TRIGGER_LOW | IRQF_ONESHOT,
> > + "max31329", &client->dev);
> > + if (ret) {
> > + dev_err(&client->dev, "unable to request IRQ\n");
> > + max31329->irq = 0;
> > + return ret;
> > + }
> > +
> > + ret = regmap_write(max31329->regmap, MAX31329_RTC_CONFIG2_REG,
> > + MAX31329_RTC_CONFIG2_ENCLKO);
> > + if (ret) {
> > + dev_err(&client->dev, "unable to configure INT pin");
> > + max31329->irq = 0;
> > + return ret;
> > + }
> > +
> > + device_set_wakeup_capable(&client->dev, true);
>
> Probably you should rather respect wakeup-source DT property.
Sure, I will configure wakeup based on the value of the wakeup-source
property from DT.
>
> > + set_bit(RTC_FEATURE_ALARM, max31329->rtc->features);
> > + }
> > +
> > + ret = devm_rtc_register_device(max31329->rtc);
> > + if (ret)
> > + return ret;
> > +
> > + max31329_trickle_config(&client->dev);
> > +
> > + nvmem_cfg.priv = max31329->regmap;
> > + devm_rtc_nvmem_register(max31329->rtc, &nvmem_cfg);
> > +
> > +#ifdef CONFIG_COMMON_CLK
> > + max31329_clkout_register_clk(max31329, client);
> > +#endif
> > +
> > + return 0;
> > +}
> > +
> > +static const struct of_device_id max31329_of_match[] = {
> > + { .compatible = "maxim,max31329", },
> > + { }
> > +};
> > +MODULE_DEVICE_TABLE(of, max31329_of_match);
> > +
> > +static struct i2c_driver max31329_driver = {
> > + .driver = {
> > + .name = "rtc-max31329",
> > + .of_match_table = of_match_ptr(max31329_of_match),
>
> of_match_ptr without maybe_unused on the table should cause compile test
> warnings. You need both or none.
I will correct this in the next patch series.
Thank you
Jagath
>
>
> Best regards,
> Krzysztof
Powered by blists - more mailing lists