From: jic23@kernel.org (Jonathan Cameron)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 4/5] i2c: add i2c_check_quirks helper function
Date: Sat, 31 Oct 2015 10:18:41 +0000 [thread overview]
Message-ID: <56349581.8070900@kernel.org> (raw)
In-Reply-To: <1446118467-26453-4-git-send-email-nicola@corna.info>
On 29/10/15 11:34, Nicola Corna wrote:
> This patch adds a i2c_check_quirks helper function to check the quirk flags
> of an i2c adapter, in a similar way to i2c_check_functionality.
>
> Signed-off-by: Nicola Corna <nicola@corna.info>
I don't know about everyone else, but I'm finding this particular style
of email thread very difficult to follow.
Perhaps either:
* Start a new thread for each new series version.
* label the whole series with a rolling version number rather than doing it
on a per patch basis.
Would just make it easier to keep track when one reads the thread a while
after it started!
Jonathan
> ---
> include/linux/i2c.h | 14 ++++++++++++++
> 1 file changed, 14 insertions(+)
>
> diff --git a/include/linux/i2c.h b/include/linux/i2c.h
> index 9697002..51028f3 100644
> --- a/include/linux/i2c.h
> +++ b/include/linux/i2c.h
> @@ -617,6 +617,20 @@ static inline int i2c_check_functionality(struct i2c_adapter *adap, u32 func)
> return (func & i2c_get_functionality(adap)) == func;
> }
>
> +/**
> + * i2c_check_quirks() - Function for checking the quirk flags in an i2c adapter
> + * @adap: i2c adapter
> + * @quirks: quirk flags
> + *
> + * Return: true if the adapter has all the specified quirk flags, false if not
> + */
> +static inline bool i2c_check_quirks(struct i2c_adapter *adap, u64 quirks)
> +{
> + if (!adap->quirks)
> + return false;
> + return (adap->quirks->flags & quirks) == quirks;
> +}
> +
> /* Return the adapter number for a specific adapter */
> static inline int i2c_adapter_id(struct i2c_adapter *adap)
> {
>
next prev parent reply other threads:[~2015-10-31 10:18 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-27 20:11 [PATCH 1/4] i2c: added i2c quirk flag for unsupported clock stretching Nicola Corna
2015-10-27 20:11 ` [PATCH 2/4] i2c: added I2C_AQ_NO_CLK_STRETCH to i2c-algo-bit.c Nicola Corna
2015-10-27 20:11 ` [PATCH 3/4] i2c: added I2C_AQ_NO_CLK_STRETCH to i2c-bcm2835.c Nicola Corna
2015-10-28 19:16 ` Eric Anholt
2015-10-29 4:10 ` Stephen Warren
2015-10-27 20:11 ` [PATCH v3 4/4] iio: humidity: si7020: added No Hold read mode Nicola Corna
2015-10-27 23:30 ` Wolfram Sang
2015-10-28 6:46 ` Nicola Corna
2015-10-28 6:58 ` [PATCH v4 " Nicola Corna
2015-10-28 9:38 ` Lars-Peter Clausen
2015-10-28 18:35 ` Nicola Corna
2015-10-28 18:46 ` Lars-Peter Clausen
2015-10-28 20:17 ` Nicola Corna
2015-10-28 20:19 ` Nicola Corna
2015-10-29 9:17 ` Lars-Peter Clausen
2015-10-29 11:34 ` [PATCH v2 1/5] i2c: add i2c quirk flag for unsupported clock stretching Nicola Corna
2015-10-29 11:34 ` [PATCH v2 2/5] i2c: add I2C_AQ_NO_CLK_STRETCH to i2c-algo-bit.c Nicola Corna
2015-11-30 17:26 ` Wolfram Sang
2015-10-29 11:34 ` [PATCH v2 3/5] i2c: add I2C_AQ_NO_CLK_STRETCH to i2c-bcm2835.c Nicola Corna
2015-11-30 17:27 ` Wolfram Sang
2015-10-29 11:34 ` [PATCH 4/5] i2c: add i2c_check_quirks helper function Nicola Corna
2015-10-31 10:18 ` Jonathan Cameron [this message]
2015-11-30 17:28 ` Wolfram Sang
2015-11-30 17:30 ` Wolfram Sang
2015-10-29 11:34 ` [PATCH v5 5/5] iio: humidity: si7020: add No Hold read mode Nicola Corna
2015-10-31 10:21 ` Jonathan Cameron
2015-11-30 17:33 ` Wolfram Sang
2015-12-05 18:24 ` Jonathan Cameron
2015-12-05 19:01 ` Wolfram Sang
2015-11-30 17:24 ` [PATCH v2 1/5] i2c: add i2c quirk flag for unsupported clock stretching Wolfram Sang
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=56349581.8070900@kernel.org \
--to=jic23@kernel.org \
--cc=linux-arm-kernel@lists.infradead.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).