On Mon, Jan 05, 2015 at 04:33:22PM +0530, Ssagarr Patil wrote: > Hi Maxime, > > > > > On Fri, Nov 14, 2014 at 05:09:09PM +0530, Ssagarr Patil wrote: > >> Hi, > >> > >> I have the SSD1306 oled device connected via spi, will the same > >> driver work ? as the current one is based on i2c what all mods would > >> be required to have it working with SPI ? > > > > It won't work out of the box, but it should be fairly easy to support. > > > > You need to had support for SPI probing, and then provide some generic > > accessors the rest of the code can use to wrap around the i2c and spi > > calls. > > > I have done the spi probing stuff, now only stuck with changing this to SPI calls, > > static int ssd1307fb_write_array(struct i2c_client *client, > struct ssd1307fb_array *array, u32 len) > { > int ret; > > len += sizeof(struct ssd1307fb_array); > > ret = i2c_master_send(client, (u8 *)array, len); > if (ret != len) { > dev_err(&client->dev, "Couldn't send I2C command.\n"); > return ret; > } > > return 0; > } > > Any help on this would be appreciated! I'm not sure what help you are expecting. This is a simple function that takes an array and sends it over I2C. It's probably even easier with SPI. Have you considered reading include/spi/spi.h? Maxime -- Maxime Ripard, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
Attachment:
signature.asc
Description: Digital signature