devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Philipp Zabel <p.zabel@pengutronix.de>
To: Ryan Chen <ryan_chen@aspeedtech.com>,
	benh@kernel.crashing.org,  joel@jms.id.au, andi.shyti@kernel.org,
	robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org,
	andrew@codeconstruct.com.au,  andriy.shevchenko@linux.intel.com,
	linux-i2c@vger.kernel.org,  openbmc@lists.ozlabs.org,
	devicetree@vger.kernel.org,
	 linux-arm-kernel@lists.infradead.org,
	linux-aspeed@lists.ozlabs.org,  linux-kernel@vger.kernel.org
Subject: Re: [PATCH v16 2/3] i2c: aspeed: support AST2600 i2c new register mode driver
Date: Mon, 24 Feb 2025 09:54:27 +0100	[thread overview]
Message-ID: <ee0f5b583aadb42e7557e1afc49c5b9af594d2c3.camel@pengutronix.de> (raw)
In-Reply-To: <20250224055936.1804279-3-ryan_chen@aspeedtech.com>

On Mo, 2025-02-24 at 13:59 +0800, Ryan Chen wrote:
> Add i2c new register mode driver to support AST2600 i2c
> new register mode. AST2600 i2c controller have legacy and
> new register mode. The new register mode have global register
> support 4 base clock for scl clock selection, and new clock
> divider mode. The new register mode have separate register
> set to control i2c controller and target. This patch is for i2c
> controller mode driver.
> 
> Signed-off-by: Ryan Chen <ryan_chen@aspeedtech.com>
> ---
>  drivers/i2c/busses/Kconfig       |   11 +
>  drivers/i2c/busses/Makefile      |    1 +
>  drivers/i2c/busses/i2c-ast2600.c | 1036 ++++++++++++++++++++++++++++++
>  3 files changed, 1048 insertions(+)
>  create mode 100644 drivers/i2c/busses/i2c-ast2600.c
> 
[...]
> diff --git a/drivers/i2c/busses/i2c-ast2600.c b/drivers/i2c/busses/i2c-ast2600.c
> new file mode 100644
> index 000000000000..bfac507693dd
> --- /dev/null
> +++ b/drivers/i2c/busses/i2c-ast2600.c
> @@ -0,0 +1,1036 @@
[...]
> +static int ast2600_i2c_probe(struct platform_device *pdev)
> +{
> +	struct device *dev = &pdev->dev;
> +	struct ast2600_i2c_bus *i2c_bus;
> +	struct resource *res;
> +	u32 global_ctrl;
> +	int ret;
> +
> +	i2c_bus = devm_kzalloc(dev, sizeof(*i2c_bus), GFP_KERNEL);
> +	if (!i2c_bus)
> +		return -ENOMEM;
> +
> +	i2c_bus->reg_base = devm_platform_ioremap_resource(pdev, 0);
> +	if (IS_ERR(i2c_bus->reg_base))
> +		return PTR_ERR(i2c_bus->reg_base);
> +
> +	i2c_bus->rst = devm_reset_control_get_shared(dev, NULL);
> +	if (IS_ERR(i2c_bus->rst))
> +		return dev_err_probe(dev, PTR_ERR(i2c_bus->rst), "Missing reset ctrl\n");
> +
> +	reset_control_deassert(i2c_bus->rst);

No reset_control_assert() in the error paths below? You could get that
and simplify this by using devm_reset_control_get_shared_deasserted().

regards
Philipp

  reply	other threads:[~2025-02-24  8:55 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-24  5:59 [PATCH v16 0/3] Add ASPEED AST2600 I2Cv2 controller driver Ryan Chen
2025-02-24  5:59 ` [PATCH v16 1/3] dt-bindings: i2c: aspeed: support for AST2600-i2cv2 Ryan Chen
2025-02-24  7:16   ` Rob Herring (Arm)
2025-02-24  9:11   ` Krzysztof Kozlowski
2025-02-24  9:12     ` Krzysztof Kozlowski
2025-02-26  9:28     ` Ryan Chen
2025-02-26  9:56       ` Krzysztof Kozlowski
2025-02-27  8:19         ` Ryan Chen
2025-02-27 20:04           ` Krzysztof Kozlowski
2025-03-05  9:35             ` Ryan Chen
2025-03-17  7:45               ` Krzysztof Kozlowski
2025-03-17  9:21                 ` Ryan Chen
2025-03-19  7:44                   ` Krzysztof Kozlowski
2025-03-19 11:12                     ` Ryan Chen
2025-03-24  7:21                       ` Krzysztof Kozlowski
2025-03-24  8:30                         ` Ryan Chen
2025-03-24  9:07                           ` Krzysztof Kozlowski
2025-03-24 10:01                             ` Ryan Chen
2025-03-24 11:10                               ` Krzysztof Kozlowski
2025-03-25  9:52                                 ` Ryan Chen
2025-03-25 10:18                                   ` Krzysztof Kozlowski
2025-09-10  7:25                                     ` Jeremy Kerr
2025-09-10  7:44                                       ` Krzysztof Kozlowski
2025-09-10  8:31                                         ` Jeremy Kerr
2025-09-11  1:27                                           ` Ryan Chen
2025-09-11  1:38                                             ` Jeremy Kerr
2025-02-24  5:59 ` [PATCH v16 2/3] i2c: aspeed: support AST2600 i2c new register mode driver Ryan Chen
2025-02-24  8:54   ` Philipp Zabel [this message]
2025-02-24  9:04     ` Ryan Chen
2025-02-24  9:32       ` Philipp Zabel
2025-02-28  1:28   ` kernel test robot
2025-02-28 12:38     ` Andy Shevchenko
2025-03-17  7:48       ` Krzysztof Kozlowski
2025-03-17  8:00         ` Andy Shevchenko
2025-03-17  8:51           ` Ryan Chen
2025-03-17  8:57             ` Krzysztof Kozlowski
2025-02-24  5:59 ` [PATCH v16 3/3] i2c: aspeed: support AST2600 i2c new register target " Ryan Chen

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=ee0f5b583aadb42e7557e1afc49c5b9af594d2c3.camel@pengutronix.de \
    --to=p.zabel@pengutronix.de \
    --cc=andi.shyti@kernel.org \
    --cc=andrew@codeconstruct.com.au \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=benh@kernel.crashing.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=joel@jms.id.au \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-aspeed@lists.ozlabs.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=openbmc@lists.ozlabs.org \
    --cc=robh@kernel.org \
    --cc=ryan_chen@aspeedtech.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 NNTP newsgroup(s).