> pl022_probe(struct amba_device *adev, struct amba_id *id)
> {
>       ...................................
>
>    /* Allocate master with space for data */
>    master = spi_alloc_master(dev, sizeof(struct pl022));
>    if (master == NULL) {
>        dev_err(&adev->dev, "probe - cannot alloc SPI master\n");
>        status = -ENOMEM;
>        goto err_no_master;
>
>    }
>
>        /* Quentin Added 2010-AUG-19 */
>        master->mode_bits=MODEBITS;
>    .........................
>
> }
>
> Now I can successfully set 'SPI mode' to mode 3.
>

It looks like some additional setup is needed in pl022_setup() to setup these
modes in hardware. Setting the mode_bits mask alone only tricks the
application into thinking SPI mode 3 has been set, but nothing will change
in hardware on the next setup if the passed mode isn't handled there too.

Some of the transfer setup config - data width, clock rate, SPI mode,
etc - are actually setup on a per transfer basis and may vary based on how
spidev (and in this case the spidev_test app) configures it. For these specific
setup items, we probably shouldn't use the static chip_info version of the
transfer config - maybe we can use the config passed in 'struct spi_transfer'
instead.

This would also reduce the size of the struct pl022_config_chip controller
data structure since some of those fields would now be handled in the
spi_transfer structure.

I guess this change is bigger than anticipated :(

> [r...@gsncommsmodule debug]# ./spidev_test -OH
> spi mode: 3
> bits per word: 8
> max speed: 500000 Hz (500 KHz)
> 00 00 00 00 00 00
> 00 00 00 00 00 00
> 00 00 00 00 00 00
> 00 00 00 00 00 00
> 00 00 00 00 00 00
> 00 00 00 00 00 00
> 00 00
>
>
> Hope this patch can be added to amba-pl022.c in the next Linux kernel
> release.
>
>
> Regards,
>
> *Quentin YANG***
>
> *Firmware Engineer***
>
> *Tel: +61-2-88787724***
>
> *CHK GridSense Pty Ltd*
>
> Unit 3, 20-36 Nancarrow Ave
>
> Meadowbank, NSW, 2114, Australia
>
> Web Site:  http://www.gridsense.com
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by
>
> Make an app they can't live without
> Enter the BlackBerry Developer Challenge
> http://p.sf.net/sfu/RIM-dev2dev
> _______________________________________________
> spi-devel-general mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/spi-devel-general
>

------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
spi-devel-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/spi-devel-general

Reply via email to