mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Billy Tsai <billy_tsai@aspeedtech.com>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: "jdelvare@suse.com" <jdelvare@suse.com>,
	"linux@roeck-us.net" <linux@roeck-us.net>,
	"robh+dt@kernel.org" <robh+dt@kernel.org>,
	"joel@jms.id.au" <joel@jms.id.au>,
	"andrew@aj.id.au" <andrew@aj.id.au>,
	"lee.jones@linaro.org" <lee.jones@linaro.org>,
	"thierry.reding@gmail.com" <thierry.reding@gmail.com>,
	"u.kleine-koenig@pengutronix.de" <u.kleine-koenig@pengutronix.de>,
	"p.zabel@pengutronix.de" <p.zabel@pengutronix.de>,
	"linux-hwmon@vger.kernel.org" <linux-hwmon@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	"linux-aspeed@lists.ozlabs.org" <linux-aspeed@lists.ozlabs.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-pwm@vger.kernel.org" <linux-pwm@vger.kernel.org>,
	BMC-SW <BMC-SW@aspeedtech.com>,
	"garnermic@meta.com" <garnermic@meta.com>
Subject: Re: [v3 3/3] hwmon: Add Aspeed ast2600 TACH support
Date: Wed, 2 Nov 2022 09:42:55 +0000	[thread overview]
Message-ID: <B823C23A-6FF5-41C6-B461-C4F8D6A00F55@aspeedtech.com> (raw)
In-Reply-To: <74726285-ae5a-459d-7b83-31025e47ea03@wanadoo.fr>

Hi CJ,

Sorry I miss it; I will wait other comments and send the v4.

Thanks

Best Regards,
Billy Tsai

On 2022/11/2, 5:37 PM, "Christophe JAILLET" <christophe.jaillet@wanadoo.fr> wrote:

    Le 02/11/2022 à 09:36, Billy Tsai a écrit :
    > This patch add the support of Tachometer which can use to monitor the
    > frequency of the input. The tach supports up to 16 channels and it's part
    > function of multi-function device "pwm-tach controller".
    > 
    > Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com>
    > Reported-by: kernel test robot <lkp@intel.com>
    > ---
    >   Documentation/hwmon/index.rst               |   1 +
    >   Documentation/hwmon/tach-aspeed-ast2600.rst |  28 ++
    >   drivers/hwmon/Kconfig                       |   9 +
    >   drivers/hwmon/Makefile                      |   1 +
    >   drivers/hwmon/tach-aspeed-ast2600.c         | 476 ++++++++++++++++++++
    >   5 files changed, 515 insertions(+)
    >   create mode 100644 Documentation/hwmon/tach-aspeed-ast2600.rst
    >   create mode 100644 drivers/hwmon/tach-aspeed-ast2600.c
    > 

    [...]

    > +static int aspeed_tach_probe(struct platform_device *pdev)
    > +{
    > +	struct device *dev = &pdev->dev;
    > +	struct device_node *np, *child;
    > +	struct aspeed_tach_data *priv;
    > +	struct device *hwmon;
    > +	struct platform_device *parent_dev;
    > +	int ret;
    > +
    > +	np = dev->parent->of_node;
    > +	if (!of_device_is_compatible(np, "aspeed,ast2600-pwm-tach"))
    > +		return dev_err_probe(dev, -ENODEV,
    > +				     "Unsupported tach device binding\n");
    > +
    > +	priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
    > +	if (!priv)
    > +		return -ENOMEM;
    > +	priv->dev = &pdev->dev;
    > +	priv->tach_channel =
    > +		devm_kcalloc(dev, TACH_ASPEED_NR_TACHS,
    > +			     sizeof(*priv->tach_channel), GFP_KERNEL);

    Hi,
    the error handling is still missing:

    	if (!priv->tach_channel)
    		return -ENOMEM;

    CJ

    > +
    > +	priv->regmap = syscon_node_to_regmap(np);
    > +	if (IS_ERR(priv->regmap))
    > +		return dev_err_probe(dev, PTR_ERR(priv->regmap),
    > +				     "Couldn't get regmap\n");
    > +	parent_dev = of_find_device_by_node(np);
    > +	priv->clk = devm_clk_get_enabled(&parent_dev->dev, NULL);
    > +	if (IS_ERR(priv->clk))
    > +		return dev_err_probe(dev, PTR_ERR(priv->clk),
    > +				     "Couldn't get clock\n");
    > +

    [...]



      reply	other threads:[~2022-11-02  9:43 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-02  8:35 [v3 0/3] Support pwm/tach driver for aspeed ast26xx Billy Tsai
2022-11-02  8:35 ` [v3 1/3] dt-bindings: Add bindings for aspeed pwm-tach Billy Tsai
2022-11-02 17:43   ` Rob Herring
2022-11-02 21:31   ` Krzysztof Kozlowski
2022-11-02  8:36 ` [v3 2/3] pwm: Add Aspeed ast2600 PWM support Billy Tsai
2022-11-02 15:56   ` Biju Das
2022-11-07  8:47     ` Billy Tsai
2022-11-07  8:55       ` Biju Das
2022-11-07  9:25         ` Billy Tsai
2022-11-07  9:31           ` Biju Das
2022-11-07  9:38             ` Biju Das
2022-11-02  8:36 ` [v3 3/3] hwmon: Add Aspeed ast2600 TACH support Billy Tsai
2022-11-02  9:37   ` Christophe JAILLET
2022-11-02  9:42     ` Billy Tsai [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=B823C23A-6FF5-41C6-B461-C4F8D6A00F55@aspeedtech.com \
    --to=billy_tsai@aspeedtech.com \
    --cc=BMC-SW@aspeedtech.com \
    --cc=andrew@aj.id.au \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=devicetree@vger.kernel.org \
    --cc=garnermic@meta.com \
    --cc=jdelvare@suse.com \
    --cc=joel@jms.id.au \
    --cc=lee.jones@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-aspeed@lists.ozlabs.org \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=p.zabel@pengutronix.de \
    --cc=robh+dt@kernel.org \
    --cc=thierry.reding@gmail.com \
    --cc=u.kleine-koenig@pengutronix.de \
    /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

all inboxes | Powered by JetHome®