From: Stephen Boyd <sboyd@codeaurora.org>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] regmap: spi: Support asynchronous I/O for SPI
Date: Mon, 28 Jan 2013 11:38:50 -0800 [thread overview]
Message-ID: <5106D3CA.4030203@codeaurora.org> (raw)
In-Reply-To: <1359295954-5209-2-git-send-email-broonie@opensource.wolfsonmicro.com>
On 01/27/13 06:12, Mark Brown wrote:
> diff --git a/drivers/base/regmap/regmap-spi.c b/drivers/base/regmap/regmap-spi.c
> index ffa46a9..bb19592 100644
> --- a/drivers/base/regmap/regmap-spi.c
> +++ b/drivers/base/regmap/regmap-spi.c
> @@ -15,6 +15,21 @@
> #include <linux/init.h>
> #include <linux/module.h>
>
> +#include "internal.h"
> +
> +struct regmap_async_spi {
> + struct regmap_async core;
> + struct spi_message m;
> + struct spi_transfer t[2];
> +};
> +
> +static void regmap_spi_complete(void *data)
> +{
> + struct regmap_async_spi *async = data;
> +
> + regmap_async_complete_cb(&async->core, async->m.status);
> +}
> +
> static int regmap_spi_write(void *context, const void *data, size_t count)
> {
> struct device *dev = context;
> @@ -40,6 +55,30 @@ static int regmap_spi_gather_write(void *context,
> return spi_sync(spi, &m);
> }
>
> +static int regmap_spi_async_write(void *context,
> + const void *reg, size_t reg_len,
> + const void *val, size_t val_len,
> + struct regmap_async *a)
> +{
> + struct regmap_async_spi *async = (void *)a;
Can you use container_of() here?
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation
next prev parent reply other threads:[~2013-01-28 19:38 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-27 14:12 [PATCH 1/2] regmap: Add asynchronous I/O support Mark Brown
2013-01-27 14:12 ` [PATCH 2/2] regmap: spi: Support asynchronous I/O for SPI Mark Brown
2013-01-28 19:38 ` Stephen Boyd [this message]
2013-01-29 1:39 ` Mark Brown
2013-01-29 1:47 ` Stephen Boyd
2013-01-29 1:54 ` Mark Brown
2013-01-29 3:58 ` Mark Brown
-- strict thread matches above, loose matches on Subject: below --
2013-01-29 4:31 [PATCH 1/2] regmap: Add asynchronous I/O support Mark Brown
2013-01-29 4:31 ` [PATCH 2/2] regmap: spi: Support asynchronous I/O for SPI Mark Brown
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=5106D3CA.4030203@codeaurora.org \
--to=sboyd@codeaurora.org \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=linux-kernel@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.