linux-rtc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
To: Jagath Jog J <jagathjog1996@gmail.com>,
	alexandre.belloni@bootlin.com, a.zummo@towertech.it,
	robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org
Cc: linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org,
	devicetree@vger.kernel.org
Subject: Re: [PATCH v1 2/2] rtc: maxim: Add Maxim max31329 real time clock.
Date: Mon, 5 Sep 2022 17:20:47 +0200	[thread overview]
Message-ID: <3ad3fb30-d56f-78be-610d-a02c9609ba42@linaro.org> (raw)
In-Reply-To: <20220904044708.7062-3-jagathjog1996@gmail.com>

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@gmail.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.

> +		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.


Best regards,
Krzysztof

  reply	other threads:[~2022-09-05 15:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-04  4:47 [PATCH v1 0/2] rtc: add Maxim max31329 real time clock Jagath Jog J
2022-09-04  4:47 ` [PATCH v1 1/2] dt-bindings: rtc: add Maxim max31329 rtc device tree bindings Jagath Jog J
2022-09-05 15:18   ` Krzysztof Kozlowski
2022-09-04  4:47 ` [PATCH v1 2/2] rtc: maxim: Add Maxim max31329 real time clock Jagath Jog J
2022-09-05 15:20   ` Krzysztof Kozlowski [this message]
2022-09-07 19:37     ` Jagath Jog J
2022-09-13  9:09   ` Dan Carpenter

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=3ad3fb30-d56f-78be-610d-a02c9609ba42@linaro.org \
    --to=krzysztof.kozlowski@linaro.org \
    --cc=a.zummo@towertech.it \
    --cc=alexandre.belloni@bootlin.com \
    --cc=devicetree@vger.kernel.org \
    --cc=jagathjog1996@gmail.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rtc@vger.kernel.org \
    --cc=robh+dt@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).