From: Pavel Machek <pavel@denx.de>
To: Biju Das <biju.das.jz@bp.renesas.com>
Cc: cip-dev@lists.cip-project.org,
Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp>,
Pavel Machek <pavel@denx.de>,
Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Subject: Re: [PATCH 6.1.y-cip 02/13] regulator: Add Renesas PMIC RAA215300 driver
Date: Thu, 17 Aug 2023 13:06:50 +0200 [thread overview]
Message-ID: <ZN3/SjL50ls+3dnD@duo.ucw.cz> (raw)
In-Reply-To: <20230816142458.147476-3-biju.das.jz@bp.renesas.com>
[-- Attachment #1: Type: text/plain, Size: 2325 bytes --]
Hi!
> +++ b/drivers/regulator/Kconfig
> @@ -1016,6 +1016,13 @@ config REGULATOR_QCOM_USB_VBUS
> Say M here if you want to include support for enabling the VBUS output
> as a module. The module will be named "qcom_usb_vbus_regulator".
>
> +config REGULATOR_RAA215300
> + tristate "Renesas RAA215300 driver"
> + select REGMAP_I2C
> + depends on I2C
> + help
> + Support for the Renesas RAA215300 PMIC.
> +
"Say M here ... the module will be named..."?
> --- /dev/null
> +++ b/drivers/regulator/raa215300.c
> @@ -0,0 +1,190 @@
> +static void raa215300_rtc_unregister_device(void *data)
> +{
> + i2c_unregister_device(data);
> + if (!clk) {
> + clk_unregister_fixed_rate(clk);
> + clk = NULL;
> + }
> +}
This one looks suspect. Should be (clk)?
> +static int raa215300_i2c_probe(struct i2c_client *client)
> +{
> + struct device *dev = &client->dev;
> + const char *clk_name = xin_name;
> + unsigned int pmic_version, val;
> + struct regmap *regmap;
> + int ret;
> +
> + regmap = devm_regmap_init_i2c(client, &raa215300_regmap_config);
> + if (IS_ERR(regmap))
> + return dev_err_probe(dev, PTR_ERR(regmap),
> + "regmap i2c init failed\n");
> +
> + ret = regmap_read(regmap, RAA215300_HW_REV, &pmic_version);
> + if (ret < 0)
> + return dev_err_probe(dev, ret, "HW rev read failed\n");
> +
> + dev_dbg(dev, "RAA215300 PMIC version 0x%04x\n", pmic_version);
> +
> + /* Clear all blocks except RTC, if enabled */
> + regmap_read(regmap, RAA215300_REG_BLOCK_EN, &val);
> + val &= RAA215300_REG_BLOCK_EN_RTC_EN;
> + regmap_write(regmap, RAA215300_REG_BLOCK_EN, val);
> +
> + /*Clear the latched registers */
"/* Clear". I would not mind checking errors from regmap here.
> + ret = raa215300_clk_present(client, xin_name);
> + if (ret < 0) {
> + return ret;
> + } else if (!ret) {
> + ret = raa215300_clk_present(client, clkin_name);
> + if (ret < 0)
> + return ret;
> +
dev_err_probe would be consistent/useful for the other returns?
> + clk = clk_register_fixed_rate(NULL, clk_name, NULL, 0, 32000);
Elsewhere, you use 32767 for a rate.
Best regards,
Pavel
--
DENX Software Engineering GmbH, Managing Director: Erika Unter
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
next prev parent reply other threads:[~2023-08-17 11:06 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-16 14:24 [PATCH 6.1.y-cip 00/13] Add Renesas PMIC RAA215300 driver and builtin RTC support Biju Das
2023-08-16 14:24 ` [PATCH 6.1.y-cip 01/13] regulator: dt-bindings: Add Renesas RAA215300 PMIC bindings Biju Das
2023-08-17 11:03 ` Pavel Machek
2023-08-17 11:18 ` Biju Das
2023-08-16 14:24 ` [PATCH 6.1.y-cip 02/13] regulator: Add Renesas PMIC RAA215300 driver Biju Das
2023-08-17 11:06 ` Pavel Machek [this message]
2023-08-17 11:42 ` Biju Das
2023-08-18 7:31 ` Pavel Machek
2023-08-18 7:33 ` Biju Das
2023-08-16 14:24 ` [PATCH 6.1.y-cip 03/13] regulator: raa215300: Add build dependency with COMMON_CLK Biju Das
2023-08-16 14:24 ` [PATCH 6.1.y-cip 04/13] dt-bindings: rtc: isl1208: Convert to json-schema Biju Das
2023-08-17 11:11 ` Pavel Machek
2023-08-17 11:23 ` Biju Das
2023-08-16 14:24 ` [PATCH 6.1.y-cip 05/13] dt-bindings: rtc: isil,isl1208: Document clock and clock-names properties Biju Das
2023-08-16 14:24 ` [PATCH 6.1.y-cip 06/13] rtc: isl1208: Drop name variable Biju Das
2023-08-16 14:24 ` [PATCH 6.1.y-cip 07/13] rtc: isl1208: Make similar I2C and DT-based matching table Biju Das
2023-08-17 11:11 ` Pavel Machek
2023-08-17 11:25 ` Biju Das
2023-08-17 13:23 ` Pavel Machek
2023-08-16 14:24 ` [PATCH 6.1.y-cip 08/13] rtc: isl1208: Drop enum isl1208_id and split isl1208_configs[] Biju Das
2023-08-16 14:24 ` [PATCH 6.1.y-cip 09/13] rtc: isl1208: Add isl1208_set_xtoscb() Biju Das
2023-08-17 11:16 ` Pavel Machek
2023-08-17 11:33 ` Biju Das
2023-08-17 13:27 ` Pavel Machek
2023-08-17 13:43 ` Biju Das
2023-08-16 14:24 ` [PATCH 6.1.y-cip 10/13] rtc: isl1208: Add support for the built-in RTC on the PMIC RAA215300 Biju Das
2023-08-16 14:24 ` [PATCH 6.1.y-cip 11/13] arm64: defconfig: Enable PMIC RAA215300 and RTC ISL 1208 configs Biju Das
2023-08-16 14:24 ` [PATCH 6.1.y-cip 12/13] arm64: dts: renesas: rzg2l-smarc-som: Enable PMIC and built-in RTC Biju Das
2023-08-16 14:24 ` [PATCH 6.1.y-cip 13/13] arm64: dts: renesas: rzg2lc-smarc-som: " Biju Das
2023-08-17 11:01 ` [PATCH 6.1.y-cip 00/13] Add Renesas PMIC RAA215300 driver and builtin RTC support Pavel Machek
2023-08-19 17:01 ` Pavel Machek
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=ZN3/SjL50ls+3dnD@duo.ucw.cz \
--to=pavel@denx.de \
--cc=biju.das.jz@bp.renesas.com \
--cc=cip-dev@lists.cip-project.org \
--cc=claudiu.beznea.uj@bp.renesas.com \
--cc=nobuhiro1.iwamatsu@toshiba.co.jp \
/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