All of lore.kernel.org
 help / color / mirror / Atom feed
From: fabio777 <fabio7774@gmail.com>
To: Ben Warren <bwarren@qstreams.com>
Cc: linuxppc-embedded@ozlabs.org
Subject: Re: SPI driver for spi_mpc83xx
Date: Wed, 28 Nov 2007 17:41:55 +0200	[thread overview]
Message-ID: <474D8C43.4030608@gmail.com> (raw)
In-Reply-To: <474C70EF.4040800@qstreams.com>

Thanks Ben
works.

Ben Warren wrote:
> Fabio,
>
> Note: I've changed the e-mail subject back to the original. In the 
> future, please ensure that it remains intact.
>
> fabio777 wrote:
>> Thanks Ben,
>>
>> Here it is
>>
>> static struct fsl_spi_platform_data k_platform_data = {
>> .initial_spmode = 0,
>> .bus_num = 1,
> Probably should be bus_num = 0
>> .max_chipselect = 1,
>> /* board specific information */
>> .activate_cs = k_cs_activate,
>> .deactivate_cs = k_cs_deactivate,
>> .sysclk = 266,
>> };
>>
>> static struct spi_board_info spi_board_info[] __initdata = { {
>> .modalias = "kplus",
>> .platform_data = &k_platform_data,
>> .max_speed_hz = 120000,
>> .bus_num = 1,
> Again, bus_num probably should be 0
>> .chip_select = 0,
>> },
>> };
>>
>>
>> struct platform_device k_plus = {
>> .name = "kplus",
> name should be "mpc83xx_spi". At initialization, the SPI controller 
> driver searches the registered platform devices (models of board 
> hardware) for a match. Without a match, it gives up.
>
>> .id = 1,
>> .dev = {
>> .platform_data = &k_platform_data,
>> },
>> };
>>
>> platform_device_register(&k_plus);
>>
> Do you add the SPI controller's resources (base address and IRQ?) 
> You'll need to in order for this to work. On my board, I use 
> 'platform_device_register_simple()', passing the name and the two 
> resources, then call 'platform_add_data()', passing in the platform 
> data structure.
>> spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info))
>>
> Good
>> and then calls spi_register_driver(&k_driver);
> I don't think this last call is needed.
>>
>> I can't get the into the *probe functions.
>> Thanks
>>
> regards,
> Ben

  reply	other threads:[~2007-11-28 15:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.3149.1196114204.3099.linuxppc-embedded@ozlabs.org>
2007-11-27 18:59 ` Linuxppc-embedded Digest, Vol 39, Issue 48 fabio777
2007-11-27 19:33   ` SPI driver for spi_mpc83xx Ben Warren
2007-11-28 15:41     ` fabio777 [this message]
2007-11-25  8:23 fabio777
2007-11-26 19:42 ` Ben Warren

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=474D8C43.4030608@gmail.com \
    --to=fabio7774@gmail.com \
    --cc=bwarren@qstreams.com \
    --cc=fabio777@gmail.com \
    --cc=linuxppc-embedded@ozlabs.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.