From: Jassi Brar <jassisinghbrar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org,
dbrownell-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: Re: [PATCH 4/6] SPI: S3C64XX: Correction for 16,32 bits bus width
Date: Thu, 9 Sep 2010 16:29:38 +0900 [thread overview]
Message-ID: <AANLkTiktKx_0d6fNPWL-_EtH6EZpYjdtbYQhou6rxiSS@mail.gmail.com> (raw)
In-Reply-To: <20100909050723.GF11833-MrY2KI0G/OVr83L8+7iqerDks+cytr/Z@public.gmane.org>
On Thu, Sep 9, 2010 at 2:07 PM, Grant Likely <grant.likely@secretlab.ca> wrote:
> On Fri, Sep 03, 2010 at 10:36:54AM +0900, Jassi Brar wrote:
>> We can't do without setting channel and bus width to
>> same size.
>> Inorder to do that, define a new callback to be used
>> to do read/write of appropriate widths.
>>
>> Signed-off-by: Jassi Brar <jassi.brar@samsung.com>
>> ---
>> drivers/spi/spi_s3c64xx.c | 78 +++++++++++++++++++++++++++++++++++++-------
>> 1 files changed, 65 insertions(+), 13 deletions(-)
>>
>> diff --git a/drivers/spi/spi_s3c64xx.c b/drivers/spi/spi_s3c64xx.c
>> index 39816bb..8aa9f85 100644
>> --- a/drivers/spi/spi_s3c64xx.c
>> +++ b/drivers/spi/spi_s3c64xx.c
>> @@ -174,12 +174,59 @@ struct s3c64xx_spi_driver_data {
>> unsigned state;
>> unsigned cur_mode, cur_bpw;
>> unsigned cur_speed;
>> + void (*do_xfer)(void *ptr, void *fifo, unsigned sz, bool rd);
>
> Looking at the code; it appears that it would be better to have
> separate read and write transfer hooks.
>
>> };
>>
>> static struct s3c2410_dma_client s3c64xx_spi_dma_client = {
>> .name = "samsung-spi-dma",
>> };
>>
>> +static void s3c64xx_spi_xfer8(void *ptr, void __iomem *fifo,
>> + unsigned len, bool read)
>> +{
>> + u8 *buf = (u8 *)ptr;
>
> ptr is already a void* which makes this an unnecessary cast.
>
>> + int i = 0;
>> +
>> + if (read)
>> + while (i < len)
>> + buf[i++] = readb(fifo);
>
> perhaps ioread8_rep() instead of open-coding? If so, then
> ioread*_rep() and iowrite*_rep() can be used in all these cases.
>
> In fact, the 8, 16 and 32 versions have the same signature and so
> could possibly be used directly without these hooks.
Great idea. I have rather avoided new callbacks and directly used the
ioread*_rep
calls. Also, I had missed setting appropriate bus width while in DMA mode.
Resending this again.
Thanks.
------------------------------------------------------------------------------
This SF.net Dev2Dev email is sponsored by:
Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
_______________________________________________
spi-devel-general mailing list
spi-devel-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/spi-devel-general
next prev parent reply other threads:[~2010-09-09 7:29 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1OrKX4-0007cO-1K>
2010-09-03 1:36 ` [PATCH 1/6] SPI: S3C64XX: Fix compilation warning Jassi Brar
[not found] ` <1283477786-31131-1-git-send-email-jassi.brar-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2010-09-09 4:56 ` Grant Likely
2010-09-03 1:36 ` [PATCH 2/6] SPI: S3C64XX: Prevent unnecessary map-unmap Jassi Brar
[not found] ` <1283477797-31163-1-git-send-email-jassi.brar-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2010-09-09 5:14 ` Grant Likely
2010-09-03 1:36 ` [PATCH 3/6] SPI: S3C64XX: Debug status read Jassi Brar
[not found] ` <1283477806-31195-1-git-send-email-jassi.brar-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2010-09-09 4:56 ` Grant Likely
2010-09-03 1:36 ` [PATCH 4/6] SPI: S3C64XX: Correction for 16,32 bits bus width Jassi Brar
[not found] ` <1283477814-31228-1-git-send-email-jassi.brar-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2010-09-09 5:07 ` Grant Likely
[not found] ` <20100909050723.GF11833-MrY2KI0G/OVr83L8+7iqerDks+cytr/Z@public.gmane.org>
2010-09-09 7:29 ` Jassi Brar [this message]
2010-09-03 1:37 ` [PATCH 5/6] SPI: S3C64XX: Define new clk src indicator Jassi Brar
[not found] ` <1283477822-31260-1-git-send-email-jassi.brar-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2010-09-09 5:08 ` Grant Likely
2010-09-03 1:37 ` [PATCH 6/6] SPI: S3C64XX: Consider the clk_from_cmu flag Jassi Brar
[not found] ` <1283477830-31555-1-git-send-email-jassi.brar-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2010-09-09 5:11 ` Grant Likely
[not found] ` <20100909051136.GH11833-MrY2KI0G/OVr83L8+7iqerDks+cytr/Z@public.gmane.org>
2010-09-09 5:29 ` Jassi Brar
[not found] ` <AANLkTim=_OxGmrvh_eutsc6ugtCBBM_4+yo8X8960Rc0-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-09-09 5:55 ` Grant Likely
[not found] ` <20100909055519.GL11833-MrY2KI0G/OVr83L8+7iqerDks+cytr/Z@public.gmane.org>
2010-09-09 7:27 ` Jassi Brar
2010-09-09 16:00 [PATCH 1/2] SPI: S3C64XX: Correction for 16,32 bits bus width Grant Likely
[not found] ` <20100909160051.GA6273-MrY2KI0G/OVr83L8+7iqerDks+cytr/Z@public.gmane.org>
2010-09-09 23:55 ` [PATCH 4/6] " Jassi Brar
[not found] ` <1284076549-17715-1-git-send-email-jassi.brar-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2010-09-10 18:00 ` Grant Likely
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=AANLkTiktKx_0d6fNPWL-_EtH6EZpYjdtbYQhou6rxiSS@mail.gmail.com \
--to=jassisinghbrar-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=dbrownell-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
--cc=grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org \
--cc=spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.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).