mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Vanalme Filip <F.Vanalme@TELEVIC.com>
To: "barebox@lists.infradead.org" <barebox@lists.infradead.org>
Subject: SPI devices
Date: Fri, 18 Feb 2011 13:48:07 +0100	[thread overview]
Message-ID: <6EE7D1502C48E44E92DCADF9DD3E0DB9017FF3B0099F@SRV-VS06.TELEVIC.COM> (raw)

My i.MX27PDK board has the PHY chip on CSPI2 and the LCD on CSPI1. The PHY uses SS0 of CSPI2, the LCD uses SS2 of CSPI1.
I'm not sure if I'm doing it right when I implement it like this :

static int imx27pdk_spi_phy_cs[] = {GPIO_PORTD + 21};

static struct spi_imx_master imx27pdk_spi_1_data = {
    .chipselect = imx27pdk_spi_phy_cs,
    .num_chipselect = ARRAY_SIZE(imx27pdk_spi_phy_cs),
};

static int imx27pdk_spi_lcd_cs[] = {GPIO_PORTD + 26};

static struct spi_imx_master imx27pdk_spi_0_data = {
    .chipselect = imx27pdk_spi_lcd_cs,
    .num_chipselect = ARRAY_SIZE(imx27pdk_spi_lcd_cs),
};

static struct spi_board_info imx27pdk_spi_board_info[] = {
    {
      .name = "LCD",
      .max_speed_hz = 3000000,
      .bus_num = 0,
      .chip_select = 2,
    },
    {
      .name = "mc13783",
      .max_speed_hz = 3000000,
      .bus_num = 1,
      .chip_select = 0,
    },
};

spi_register_board_info(imx27pdk_spi_board_info, ARRAY_SIZE(imx27pdk_spi_board_info));
imx27_add_spi0(&imx27pdk_spi_0_data);
imx27_add_spi1(&imx27pdk_spi_1_data);


Is this OK ? I.e. I'm not sure how to use bus_num and chip_select


Filip 


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

                 reply	other threads:[~2011-02-18 12:48 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=6EE7D1502C48E44E92DCADF9DD3E0DB9017FF3B0099F@SRV-VS06.TELEVIC.COM \
    --to=f.vanalme@televic.com \
    --cc=barebox@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