From: Himanshu Jha <himanshujha199640@gmail.com>
To: Manish Narani <manish.narani@xilinx.com>
Cc: jic23@kernel.org, knaack.h@gmx.de, lars@metafoo.de,
pmeerw@pmeerw.net, michal.simek@xilinx.com, lee.jones@linaro.org,
broonie@kernel.org, arnaud.pouliquen@st.com,
quentin.schulz@free-electrons.com, linus.walleij@linaro.org,
ksenija.stanojevic@gmail.com, arnd@arndb.de, martenli@axis.com,
jan.kiszka@siemens.com, lukas@wunner.de, vilhelm.gray@gmail.com,
geert+renesas@glider.be, fabio.estevam@nxp.com,
jackoalan@gmail.com, mnarani@xilinx.com, mike.looijmans@topic.nl,
alexander.sverdlin@gmail.com, jacopo+renesas@jmondi.org,
linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
Subject: Re: [RFC PATCH] iio: adc: Add Xilinx AMS driver
Date: Sat, 17 Mar 2018 01:49:25 +0530 [thread overview]
Message-ID: <20180316201925.GA18013@himanshu-Vostro-3559> (raw)
In-Reply-To: <1521124947-18950-1-git-send-email-mnarani@xilinx.com>
On Thu, Mar 15, 2018 at 08:12:27PM +0530, Manish Narani wrote:
> The AMS includes an ADC as well as on-chip sensors that can be used to
> sample external voltages and monitor on-die operating conditions, such as
> temperature and supply voltage levels. The AMS has two SYSMON blocks.
> PL-SYSMON block is capable of monitoring off chip voltage and temperature.
> PL-SYSMON block has DRP, JTAG and I2C interface to enable monitoring from
> external master. Out of these interface currently only DRP is supported.
> Other block PS-SYSMON is memory mapped to PS.
>
> The AMS can use internal channels to monitor voltage and temperature
> as well as one primary and up to 16 auxiliary channels for measuring
> external voltages.
>
> The voltage and temperature monitoring channels also have event
> capability which allows to generate an interrupt when their value
> falls below or raises above a set threshold.
>
> Signed-off-by: Manish Narani <mnarani@xilinx.com>
> ---
[..]
> +static const struct of_device_id ams_of_match_table[] = {
> + { .compatible = "xlnx,zynqmp-ams", &ams_pl_apb },
> + { }
> +};
> +MODULE_DEVICE_TABLE(of, ams_of_match_table);
[..]
> +static int ams_probe(struct platform_device *pdev)
> +{
> + struct iio_dev *indio_dev;
> + struct ams *ams;
> + struct resource *res;
> + const struct of_device_id *id;
> + int ret;
> +
> + if (!pdev->dev.of_node)
> + return -ENODEV;
> +
> + id = of_match_node(ams_of_match_table, pdev->dev.of_node);
> + if (!id)
> + return -ENODEV;
Is the above check required ?
Isn't the probe function called if and only if a match is found in
ams_of_match_table[] since it is a pure OF driver ?
And therefore the above condition would never happen!
> +static struct platform_driver ams_driver = {
> + .probe = ams_probe,
> + .remove = ams_remove,
> + .driver = {
> + .name = "ams",
> + .pm = &ams_pm_ops,
> + .of_match_table = ams_of_match_table,
> + },
> +};
> +module_platform_driver(ams_driver);
--
Thanks
Himanshu Jha
next prev parent reply other threads:[~2018-03-16 20:19 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-15 14:42 Manish Narani
2018-03-15 15:51 ` Peter Meerwald-Stadler
2018-03-17 18:16 ` Jonathan Cameron
2018-03-16 20:19 ` Himanshu Jha [this message]
2018-03-17 18:19 ` Jonathan Cameron
2018-03-20 9:44 ` Geert Uytterhoeven
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=20180316201925.GA18013@himanshu-Vostro-3559 \
--to=himanshujha199640@gmail.com \
--cc=alexander.sverdlin@gmail.com \
--cc=arnaud.pouliquen@st.com \
--cc=arnd@arndb.de \
--cc=broonie@kernel.org \
--cc=fabio.estevam@nxp.com \
--cc=geert+renesas@glider.be \
--cc=jackoalan@gmail.com \
--cc=jacopo+renesas@jmondi.org \
--cc=jan.kiszka@siemens.com \
--cc=jic23@kernel.org \
--cc=knaack.h@gmx.de \
--cc=ksenija.stanojevic@gmail.com \
--cc=lars@metafoo.de \
--cc=lee.jones@linaro.org \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lukas@wunner.de \
--cc=manish.narani@xilinx.com \
--cc=martenli@axis.com \
--cc=michal.simek@xilinx.com \
--cc=mike.looijmans@topic.nl \
--cc=mnarani@xilinx.com \
--cc=pmeerw@pmeerw.net \
--cc=quentin.schulz@free-electrons.com \
--cc=vilhelm.gray@gmail.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
all inboxes | Powered by JetHome®