linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Raju Sana <venkat.rajuece-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Ben Gamari <bgamari.foss-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org,
	beagleboard-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org,
	linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] beagledaq: Hack in cs_gpios
Date: Mon, 5 Sep 2011 18:12:26 +0530	[thread overview]
Message-ID: <CA+dZkamSp1O_e+uEEhudCGFedUC0mzHg0Ur4bJQ76mMekHkZGw@mail.gmail.com> (raw)
In-Reply-To: <1314712343-27367-1-git-send-email-bgamari.foss-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

Hi Ben,

The McSPI1 has got  "num_cs"  as 4.
I would like to use McSPI1 to select my 3 chips based on the two GPIO pins.

Could you please give me some pointers on this.

Thanks,
Venkat Raju.





On Tue, Aug 30, 2011 at 7:22 PM, Ben Gamari <bgamari.foss-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:

> ---
>  arch/arm/mach-omap2/board-omap3beagle.c |    4 ++--
>  arch/arm/mach-omap2/devices.c           |   15 +++++++++++++++
>  2 files changed, 17 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/board-omap3beagle.c
> b/arch/arm/mach-omap2/board-omap3beagle.c
> index 67999da..481c1a9 100644
> --- a/arch/arm/mach-omap2/board-omap3beagle.c
> +++ b/arch/arm/mach-omap2/board-omap3beagle.c
> @@ -661,8 +661,8 @@ static struct spi_board_info
> beagledaq_mcspi_board_info[] = {
>        },
>  };
>
> -static int mcspi3_cs_gpios[4];
> -static int mcspi4_cs_gpios[4];
> +int mcspi3_cs_gpios[4];
> +int mcspi4_cs_gpios[4];
>
>  static void __init beagledaq_init(void)
>  {
> diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
> index 5b8ca68..6808251 100644
> --- a/arch/arm/mach-omap2/devices.c
> +++ b/arch/arm/mach-omap2/devices.c
> @@ -341,6 +341,9 @@ struct omap_device_pm_latency omap_mcspi_latency[] = {
>        },
>  };
>
> +extern int mcspi3_cs_gpios[4];
> +extern int mcspi4_cs_gpios[4];
> +
>  static int omap_mcspi_init(struct omap_hwmod *oh, void *unused)
>  {
>        struct omap_device *od;
> @@ -369,6 +372,18 @@ static int omap_mcspi_init(struct omap_hwmod *oh, void
> *unused)
>                        return -EINVAL;
>        }
>
> +       /* HACK: Not enough time to figure out how to export cs_gpios from
> +        * board file to driver correctly */
> +       if (spi_num == 2) {
> +               // Setup McSPI3 cs_gpios
> +               pdata->num_cs = 4;
> +               pdata->cs_gpios = mcspi3_cs_gpios;
> +       } else if (spi_num == 3) {
> +               // Setup McSPI4 cs_gpios
> +               pdata->num_cs = 4;
> +               pdata->cs_gpios = mcspi4_cs_gpios;
> +       }
> +
>        spi_num++;
>        od = omap_device_build(name, spi_num, oh, pdata,
>                                sizeof(*pdata), omap_mcspi_latency,
> --
> 1.7.4.1
>
>
------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better 
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev

      parent reply	other threads:[~2011-09-05 12:42 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-20 19:47 (no subject) Ben Gamari
2010-01-21  0:04 ` Ben Dooks
2010-01-21  0:04 ` (no subject) Ben Dooks
2010-01-21  0:04 ` Ben Dooks
2010-01-22 15:53 ` Re: Ben Gamari
2010-01-28  4:10 ` McSPI questions pertaining to GPIO chip select support Ben Gamari
     [not found] ` <1264651770-sup-5197@ben-laptop>
2010-01-28  4:15   ` Bill Gatliff
2010-01-28  4:25     ` Ben Gamari
2010-01-28  4:27       ` Bill Gatliff
2010-01-28  4:33   ` jassi brar
     [not found]     ` <1b68c6791001272033q60dd31dbif4de285cd9bac83d-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-01-29  0:32       ` Ben Gamari
2010-01-29  1:09         ` jassi brar
     [not found]           ` <1b68c6791001281709l7d11da30lee486632e85b99cb-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-01-29  1:58             ` Ben Gamari
2010-12-21 17:56       ` [RFC PATCH] GPIO chip select support for McSPI Ben Gamari
2010-12-21 17:56       ` [PATCH] mcspi: Add support for GPIO chip select lines Ben Gamari
     [not found]     ` <1292954195-20204-2-git-send-email-bgamari.foss@gmail.com>
2010-12-23 19:59       ` Tony Lindgren
2010-12-23 21:38       ` Grant Likely
2010-12-23 23:09         ` Ben Gamari
2010-12-24  0:37           ` Grant Likely
2010-12-24  2:27             ` Ben Gamari
2010-12-24  3:28               ` Grant Likely
2010-12-24  6:05                 ` Ben Gamari
2011-02-12  8:33                   ` Grant Likely
2011-02-13 22:07                     ` Ben Gamari
2011-08-30 10:14   ` McSPI questions pertaining to GPIO chip select support Raju Sana
2011-08-30 13:50     ` Ben Gamari
2011-08-30 13:50       ` [PATCH] mcspi: Add support for GPIO chip select lines Ben Gamari
2011-08-30 13:52       ` [PATCH] beagledaq: Hack in cs_gpios Ben Gamari
     [not found]         ` <1314712343-27367-1-git-send-email-bgamari.foss-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2011-09-05 12:42           ` Raju Sana [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=CA+dZkamSp1O_e+uEEhudCGFedUC0mzHg0Ur4bJQ76mMekHkZGw@mail.gmail.com \
    --to=venkat.rajuece-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=beagleboard-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
    --cc=bgamari.foss-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=linux-omap-u79uwXL29TY76Z2rM5mHXA@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).