On Tue, Sep 14, 2010 at 7:18 PM, Mike Frysinger <[email protected]> wrote:
> On Tue, Sep 14, 2010 at 06:29,  <[email protected]> wrote:
>> Modified: trunk/drivers/spi/bfin_sport_spi.c (9136 => 9137)
>>
>> --- trunk/drivers/spi/bfin_sport_spi.c        2010-09-14 08:34:15 UTC (rev 
>> 9136)
>> +++ trunk/drivers/spi/bfin_sport_spi.c        2010-09-14 10:29:03 UTC (rev 
>> 9137)
>> @@ -348,6 +348,11 @@
>>       transfer = drv_data->cur_transfer;
>>       chip = drv_data->cur_chip;
>>
>> +     if (transfer->speed_hz) {
>> +             chip->baud = hz_to_spi_baud(transfer->speed_hz);
>> +             drv_data->regs->tclkdiv = chip->baud;
>> +             SSYNC();
>> +     }
>
> i dont think this is correct.  chip->baud is the default speed which
> is setup in the bfin_sport_spi_setup() function.  by changing it in
> the transfer function, the default speed is now whatever the last
> transfer set things to.
> -mike
>

bfin_sport_spi_setup() only setup the default speed.
But the user maybe need to set special speed in a spi transfer.
It was implemented through ioctl comand  "CMD_SPI_SET_BAUDRATE" in
adc_spi_ioctl(),
and this value will be transfer to spi controller driver through
struct spi_transfer.
struct spi_transfer t = {
             .len            = count,
             .speed_hz       = spi_adc->hz,
};

What about set back the default speed after a spi_transfer ?

-- 
Regards,
--Bob
_______________________________________________
Linux-kernel-commits mailing list
[email protected]
https://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits

Reply via email to