New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fbtft + device tree on sam9g25 cpu (ariag25) #80

Closed
mih90 opened this Issue Feb 25, 2014 · 23 comments

Comments

Projects
None yet
6 participants
@mih90

mih90 commented Feb 25, 2014

Hi,
I have used fbtft in the past with raspberry pi without much problems, but i have switched for smaller cpu and now i'm trying to do the same here.

The cpu module i'm using is ariag25 from acmesystems. Curently i'm working with kernel version 3.14 which has device tree's enabled.

First i tried with fbtft_device but it was giving me -16 error when creating new spi device. From kernel doc I read that error means - 'Device or resource busy'

My second try was with builtin driver and proper device tree node.
I changed this code in fbtft.h so to bind driver with device tree:

static const struct of_device_id fbtft_dt_id[] = {             
    {.compatible = _name, },                       
    { }                                
};                                     
MODULE_DEVICE_TABLE(of,fbtft_dt_id);                       

static struct spi_driver fbtft_driver_spi_driver = {                       
    .driver = {                                                        
        .name   = _name,                                           
        .owner  = THIS_MODULE,                                     
        .of_match_table = of_match_ptr(fbtft_dt_id),               
    },                                                                 
    .probe  = fbtft_driver_probe_spi,                                  
    .remove = fbtft_driver_remove_spi,                                 
}; 

But that didn't help much because i there were errors that there are no pin definitions set.

Then I added this piece of code to fbtft-core.c to read values from device tree:

int fbtft_of_probe(struct spi_device *spi)
{
   struct fbtft_platform_data   *pdata;
   int buswidth;
   int reset;
   int dc;
   struct fbtft_gpio gpio_settings[] = {
        {"reset",0},
        {"dc",0},
        {},
   };

   if (!of_device_is_available(spi->dev.of_node)) {
       dev_err(&spi->dev, "No device tree data available.\n");
       return -EINVAL;
   }else {
        dev_err(&spi->dev,"Device tree data available.\n");
   }

   if (of_property_read_u32(spi->dev.of_node, "buswidth", &buswidth)) {
       dev_err(&spi->dev, "Missing -buswidth- property in the DT.\n");
       return -EINVAL;
   }else {
        dev_err(&spi->dev, "buswidth read properly, value: %d",buswidth);
   }

   if (of_property_read_u32(spi->dev.of_node, "reset", &reset)) {
       dev_err(&spi->dev, "Missing -reset- property in the DT.\n");
       return -EINVAL;
   }else {
        dev_err(&spi->dev, "reset pin read properly, value: %d",reset);
        gpio_settings[0].gpio = reset;
   }

   if (of_property_read_u32(spi->dev.of_node, "dc", &dc)) {
       dev_err(&spi->dev, "Missing -dc- property in the DT.\n");
       return -EINVAL;
   }else {
        dev_err(&spi->dev, "dc pin read properly, value: %d",dc);
        gpio_settings[1].gpio = dc;
   }

   pdata = kzalloc(sizeof(*pdata), GFP_KERNEL);
   pdata->display.buswidth = buswidth;
   pdata->gpios = gpio_settings;

   spi->dev.platform_data = pdata;

   return 0;
}

i read those values in fbtft_probe_common function, like this:

int fbtft_probe_common(struct fbtft_display *display,
            struct spi_device *sdev, struct platform_device *pdev)
{
    struct device *dev;
    struct fb_info *info;
    struct fbtft_par *par;
    struct fbtft_platform_data *pdata;
    int ret;
    int status;

    //----------------------------------------
    status = fbtft_of_probe(sdev);
    //----------------------------------------
....

But after rebooting the system it hangs at the fbtft_verify_gpios function saying that there is no dc pin set. I'm attaching screenshot:
dmesg_log

And here is my device tree node:

        device@0 {
          compatible = "fb_st7735r";
          // spi-max-frequency = <50000000>;  // 50 MHz
          spi-max-frequency = <5000000>;        // 5 MHz
          reg = <0>;
          buswidth = <8>;
          reset = <4>;
          dc = <3>;
        };

So right now i can read all data that i need from device tree, but i don't know what is the right way to pass it to the driver. Could you point me into right direction ?
In which function should i set plaform data so the driver could read it ?
And to which structures should I save it ?

Sorry for the long post ;)

Regards Michał.

@notro

This comment has been minimized.

Show comment
Hide comment
@notro

notro Feb 26, 2014

Owner

You are allocating gpio_settings on the stack and using it outside the function.
I considered adding DT support to FBTFT, but I have decided to rewrite it completly to fix some architectural shortcomings.

FBTFT is working on the BeagleBone which uses DT. Did you get 'Device or resource busy' with fbtft_device as builtin or loadable module?

Owner

notro commented Feb 26, 2014

You are allocating gpio_settings on the stack and using it outside the function.
I considered adding DT support to FBTFT, but I have decided to rewrite it completly to fix some architectural shortcomings.

FBTFT is working on the BeagleBone which uses DT. Did you get 'Device or resource busy' with fbtft_device as builtin or loadable module?

@mih90

This comment has been minimized.

Show comment
Hide comment
@mih90

mih90 Feb 26, 2014

Thanks alot, stupid mistake, It works now ! :)

I get this error with fbtft_device as loadable module. The spi bus number in my cpu is 32766. I read somewhere that when using device tree, the busnumber is attributed dynamically so it just takes frist free address. And that's why it may be different than 0 or 1. I attached a screenshot from console, with all errors.

I don't have spi32766.0 device in /dev because it's taken by fb0, but without it the errors where the same which is little strange.

fbtft_device_log

Keep it up, great work !,
Regards Michał

mih90 commented Feb 26, 2014

Thanks alot, stupid mistake, It works now ! :)

I get this error with fbtft_device as loadable module. The spi bus number in my cpu is 32766. I read somewhere that when using device tree, the busnumber is attributed dynamically so it just takes frist free address. And that's why it may be different than 0 or 1. I attached a screenshot from console, with all errors.

I don't have spi32766.0 device in /dev because it's taken by fb0, but without it the errors where the same which is little strange.

fbtft_device_log

Keep it up, great work !,
Regards Michał

@erazor83

This comment has been minimized.

Show comment
Hide comment
@erazor83

erazor83 Mar 14, 2014

Hi.

Is there a way to get this running without the code changes?

erazor83 commented Mar 14, 2014

Hi.

Is there a way to get this running without the code changes?

@zenmetsu

This comment has been minimized.

Show comment
Hide comment
@zenmetsu

zenmetsu Mar 26, 2014

I'm running into the same problem. I'm going to try the code changes to see if I can get it running.

Thanks for working this out Michał.

zenmetsu commented Mar 26, 2014

I'm running into the same problem. I'm going to try the code changes to see if I can get it running.

Thanks for working this out Michał.

@erazor83

This comment has been minimized.

Show comment
Hide comment
@erazor83

erazor83 Mar 26, 2014

The changes worked for me. I also was able to get the kernel output on this display.

erazor83 commented Mar 26, 2014

The changes worked for me. I also was able to get the kernel output on this display.

@zenmetsu

This comment has been minimized.

Show comment
Hide comment
@zenmetsu

zenmetsu Mar 26, 2014

any chance you could post the modified files? Not sure I'll be able to figure out all the changes needed to the first file.

zenmetsu commented Mar 26, 2014

any chance you could post the modified files? Not sure I'll be able to figure out all the changes needed to the first file.

@erazor83

This comment has been minimized.

Show comment
Hide comment
@erazor83

erazor83 Mar 26, 2014

i can also upload my kernel binary if you want

erazor83 commented Mar 26, 2014

i can also upload my kernel binary if you want

@zenmetsu

This comment has been minimized.

Show comment
Hide comment
@zenmetsu

zenmetsu Mar 26, 2014

i'm running 3.13.6, will it insert? :)

zenmetsu commented Mar 26, 2014

i'm running 3.13.6, will it insert? :)

@zenmetsu

This comment has been minimized.

Show comment
Hide comment
@zenmetsu

zenmetsu Mar 26, 2014

i've gotten the changes listed in this thread made to my files and they compile fine, but I'm not certain about how Michał made the final change to fix the issue where he was only allocating gpio settings on the stack.

I'm not much of a C guy... learning, but some concepts.... zooom, right over the noggin.

zenmetsu commented Mar 26, 2014

i've gotten the changes listed in this thread made to my files and they compile fine, but I'm not certain about how Michał made the final change to fix the issue where he was only allocating gpio settings on the stack.

I'm not much of a C guy... learning, but some concepts.... zooom, right over the noggin.

@zenmetsu

This comment has been minimized.

Show comment
Hide comment
@zenmetsu

zenmetsu Mar 26, 2014

Looks as if I got to the same point with regards to trying to use the DT values outside of the probe function. :/

I'm using a Core9G25 module which is very similar to the AriaG25 but has an added 256MB nand flash part. I think my .dts is screwed up a bit since I am not getting DMA on SPI, but I'll tackle that at a later time.

[ 8.445312] atmel_spi f0000000.spi: version: 0x212 [ 8.445312] atmel_spi f0000000.spi: DMA TX channel not available, SPI unable to use DMA [ 8.445312] atmel_spi f0000000.spi: Atmel SPI Controller using PIO only [ 8.445312] atmel_spi f0000000.spi: Atmel SPI Controller at 0xf0000000 (irq 29) [ 8.445312] atmel_spi f0000000.spi: master is unqueued, this is deprecated [ 8.843750] fb_ssd1306 spi32766.0: Device tree data available. [ 8.843750] fb_ssd1306 spi32766.0: buswidth read properly, value: 8 [ 8.843750] fb_ssd1306 spi32766.0: reset pin read properly, value: 21 [ 8.843750] fb_ssd1306 spi32766.0: dc pin read properly, value: 4 [ 8.843750] fb_ssd1306 spi32766.0: Missing info about 'dc' gpio. Aborting. [ 8.843750] fb_ssd1306: probe of spi32766.0 failed with error -22

zenmetsu commented Mar 26, 2014

Looks as if I got to the same point with regards to trying to use the DT values outside of the probe function. :/

I'm using a Core9G25 module which is very similar to the AriaG25 but has an added 256MB nand flash part. I think my .dts is screwed up a bit since I am not getting DMA on SPI, but I'll tackle that at a later time.

[ 8.445312] atmel_spi f0000000.spi: version: 0x212 [ 8.445312] atmel_spi f0000000.spi: DMA TX channel not available, SPI unable to use DMA [ 8.445312] atmel_spi f0000000.spi: Atmel SPI Controller using PIO only [ 8.445312] atmel_spi f0000000.spi: Atmel SPI Controller at 0xf0000000 (irq 29) [ 8.445312] atmel_spi f0000000.spi: master is unqueued, this is deprecated [ 8.843750] fb_ssd1306 spi32766.0: Device tree data available. [ 8.843750] fb_ssd1306 spi32766.0: buswidth read properly, value: 8 [ 8.843750] fb_ssd1306 spi32766.0: reset pin read properly, value: 21 [ 8.843750] fb_ssd1306 spi32766.0: dc pin read properly, value: 4 [ 8.843750] fb_ssd1306 spi32766.0: Missing info about 'dc' gpio. Aborting. [ 8.843750] fb_ssd1306: probe of spi32766.0 failed with error -22
@zenmetsu

This comment has been minimized.

Show comment
Hide comment
@zenmetsu

zenmetsu Mar 26, 2014

Looks like I managed to get it. I'm a novice and probably did this incorrectly with a kzalloc, but it works.

[ 8.515625] atmel_spi f0000000.spi: version: 0x212 [ 8.515625] atmel_spi f0000000.spi: DMA TX channel not available, SPI unable to use DMA [ 8.515625] atmel_spi f0000000.spi: Atmel SPI Controller using PIO only [ 8.515625] atmel_spi f0000000.spi: Atmel SPI Controller at 0xf0000000 (irq 29) [ 8.515625] atmel_spi f0000000.spi: master is unqueued, this is deprecated [ 8.882812] fb_ssd1306 spi32766.0: Device tree data available. [ 8.882812] fb_ssd1306 spi32766.0: buswidth read properly, value: 8 [ 8.882812] fb_ssd1306 spi32766.0: reset pin read properly, value: 21 [ 8.882812] fb_ssd1306 spi32766.0: dc pin read properly, value: 4 [ 8.882812] fb_ssd1306 spi32766.0: GPIOS set correctly reset=21, dc=4 [ 9.976562] graphics fb0: fb_ssd1306 frame buffer, 128x64, 16 KiB video memory, 4 KiB buffer memory, fps=21, spi32766.0 at 5 MHz

zenmetsu commented Mar 26, 2014

Looks like I managed to get it. I'm a novice and probably did this incorrectly with a kzalloc, but it works.

[ 8.515625] atmel_spi f0000000.spi: version: 0x212 [ 8.515625] atmel_spi f0000000.spi: DMA TX channel not available, SPI unable to use DMA [ 8.515625] atmel_spi f0000000.spi: Atmel SPI Controller using PIO only [ 8.515625] atmel_spi f0000000.spi: Atmel SPI Controller at 0xf0000000 (irq 29) [ 8.515625] atmel_spi f0000000.spi: master is unqueued, this is deprecated [ 8.882812] fb_ssd1306 spi32766.0: Device tree data available. [ 8.882812] fb_ssd1306 spi32766.0: buswidth read properly, value: 8 [ 8.882812] fb_ssd1306 spi32766.0: reset pin read properly, value: 21 [ 8.882812] fb_ssd1306 spi32766.0: dc pin read properly, value: 4 [ 8.882812] fb_ssd1306 spi32766.0: GPIOS set correctly reset=21, dc=4 [ 9.976562] graphics fb0: fb_ssd1306 frame buffer, 128x64, 16 KiB video memory, 4 KiB buffer memory, fps=21, spi32766.0 at 5 MHz
@zenmetsu

This comment has been minimized.

Show comment
Hide comment
@zenmetsu

zenmetsu Mar 27, 2014

framebuffer works fine, but now for a seriously stupid question. Since I do not have a keyboard attached yet, is there any way to attach the framebuffer to the ttyS0, or one of the PTY's from an ssh session?

zenmetsu commented Mar 27, 2014

framebuffer works fine, but now for a seriously stupid question. Since I do not have a keyboard attached yet, is there any way to attach the framebuffer to the ttyS0, or one of the PTY's from an ssh session?

erazor83 added a commit to erazor83/fbtft that referenced this issue Mar 28, 2014

@erazor83

This comment has been minimized.

Show comment
Hide comment
@erazor83

erazor83 Mar 28, 2014

The changes: erazor83@a226923

And the SPI DTS section:

spi0: spi@f0000000 {
  status = "okay";
  cs-gpios = <&pioA 14 0>, <&pioA 2 0>, <0>, <0>;
  device@0 {
    compatible = "fb_st7735r";
    spi-max-frequency = <5000000>;
    reg = <0>;
    buswidth = <8>;
    reset = <3>; //CTS0
    dc = <4>; //PA4
  };
  device@1 {
    compatible = "spidev";
    spi-max-frequency = <5000000>;
    reg = <1>;
  };
};

erazor83 commented Mar 28, 2014

The changes: erazor83@a226923

And the SPI DTS section:

spi0: spi@f0000000 {
  status = "okay";
  cs-gpios = <&pioA 14 0>, <&pioA 2 0>, <0>, <0>;
  device@0 {
    compatible = "fb_st7735r";
    spi-max-frequency = <5000000>;
    reg = <0>;
    buswidth = <8>;
    reset = <3>; //CTS0
    dc = <4>; //PA4
  };
  device@1 {
    compatible = "spidev";
    spi-max-frequency = <5000000>;
    reg = <1>;
  };
};
@nzmichaelh

This comment has been minimized.

Show comment
Hide comment
@nzmichaelh

nzmichaelh Jul 12, 2014

Contributor

I found part of the problem with the Arietta. The standard device tree file includes sections for the four chip select channels, so when you install fbtft_device it tries to create the same channel again and fails when trying to reallocate the GPIO line.

The solution is to trim the chip select sections from the DTB.

Contributor

nzmichaelh commented Jul 12, 2014

I found part of the problem with the Arietta. The standard device tree file includes sections for the four chip select channels, so when you install fbtft_device it tries to create the same channel again and fails when trying to reallocate the GPIO line.

The solution is to trim the chip select sections from the DTB.

@cledic

This comment has been minimized.

Show comment
Hide comment
@cledic

cledic Jul 18, 2014

Hello nzmichaelh,
did you find a solution for the Arietta version? I tryed a DTB with a single chip select, CS1, and after, like the one posted from erazor83, with two chip select, but without success.

cledic commented Jul 18, 2014

Hello nzmichaelh,
did you find a solution for the Arietta version? I tryed a DTB with a single chip select, CS1, and after, like the one posted from erazor83, with two chip select, but without success.

@nzmichaelh

This comment has been minimized.

Show comment
Hide comment
@nzmichaelh

nzmichaelh Jul 18, 2014

Contributor

@cledic yip, I got it working. The DTB I used is at https://juju.net.nz/michaelh/files/nokia3310.dts.gz. The options I used are options fbtft_device name=nokia3310 busnum=32766 cs=2 gpios=reset:26,dc:27. Note that the default pins overlap with either MOSI or SCLK. The Nokia 3310 driver doesn't work with modern boards but I have a patch in progress.

Contributor

nzmichaelh commented Jul 18, 2014

@cledic yip, I got it working. The DTB I used is at https://juju.net.nz/michaelh/files/nokia3310.dts.gz. The options I used are options fbtft_device name=nokia3310 busnum=32766 cs=2 gpios=reset:26,dc:27. Note that the default pins overlap with either MOSI or SCLK. The Nokia 3310 driver doesn't work with modern boards but I have a patch in progress.

@erazor83

This comment has been minimized.

Show comment
Hide comment
@erazor83

erazor83 Jul 18, 2014

my dts was for inkernel fbtft and you need to patch fbtft

This is also pretty usefull: http://www.acmesystems.it/pinout_arietta

You need to build your own kernel and dtb from dts...

erazor83 commented Jul 18, 2014

my dts was for inkernel fbtft and you need to patch fbtft

This is also pretty usefull: http://www.acmesystems.it/pinout_arietta

You need to build your own kernel and dtb from dts...

@cledic

This comment has been minimized.

Show comment
Hide comment
@cledic

cledic Jul 18, 2014

Hello to all, and thanks for the replay.

@erazor83 yes I build a custom kernel with spidev and the fbtft modules. I use this dts:

spi1: spi@f0004000 {
status = "okay";
cs-gpios = <&pioA 8 0>, <&pioA 0 0>, <0>, <0>;

    device@0 {
            compatible = "fb_hx8347d";
            spi-max-frequency = <25000000>;     // 25 MHz
            reg = <0>;
            buswidth = <8>;
            regwidth = <8>;
            reset = <66>;
            dc = <67>;
    };

    device@1 {
            compatible = "spidev";
            spi-max-frequency = <25000000>;     // 25 MHz
            reg = <1>;
    };

};

After boot I see this msgs:
root@arietta:~# dmesg | less
...
atmel_spi f0004000.spi: version: 0x212
atmel_spi f0004000.spi: Using dma1chan0 (tx) and dma1chan1 (rx) for DMA transfers
atmel_spi f0004000.spi: Atmel SPI Controller at 0xf0004000 (irq 25)
...
fb_hx8347d spi32766.0: Device tree data available.
fb_hx8347d spi32766.0: buswidth read properly, value: 8
fb_hx8347d spi32766.0: reset pin read properly, value: 66
fb_hx8347d spi32766.0: dc pin read properly, value: 67
random: nonblocking pool is initialized
graphics fb0: fb_hx8347d frame buffer, 320x240, 150 KiB video memory, 4 KiB DMA buffer memory, fps=21, spi32766.0 at 25 MHz

But I receive an error when I run:
root@arietta:~# modprobe fbtft_device name=mi0283qt-2 cs=0
ERROR: could not insert 'fbtft_device': Invalid argument

fbtft_device: SPI devices registered:
fbtft_device: fb_hx8347d spi32766.0 25000kHz 8 bits mode=0x00
fbtft_device: spidev spi32766.1 25000kHz 8 bits mode=0x03
fbtft_device: 'fb' Platform devices registered:
fbtft_device: spi_busnum_to_master(0) returned NULL
fbtft_device: failed to register SPI device

And "cat /dev/urandom > /dev/fb0" have no result on the LCD.

@nzmichaelh I modified the dts file like yours but without success.

Where am I wrong?
TIA
Clemente

cledic commented Jul 18, 2014

Hello to all, and thanks for the replay.

@erazor83 yes I build a custom kernel with spidev and the fbtft modules. I use this dts:

spi1: spi@f0004000 {
status = "okay";
cs-gpios = <&pioA 8 0>, <&pioA 0 0>, <0>, <0>;

    device@0 {
            compatible = "fb_hx8347d";
            spi-max-frequency = <25000000>;     // 25 MHz
            reg = <0>;
            buswidth = <8>;
            regwidth = <8>;
            reset = <66>;
            dc = <67>;
    };

    device@1 {
            compatible = "spidev";
            spi-max-frequency = <25000000>;     // 25 MHz
            reg = <1>;
    };

};

After boot I see this msgs:
root@arietta:~# dmesg | less
...
atmel_spi f0004000.spi: version: 0x212
atmel_spi f0004000.spi: Using dma1chan0 (tx) and dma1chan1 (rx) for DMA transfers
atmel_spi f0004000.spi: Atmel SPI Controller at 0xf0004000 (irq 25)
...
fb_hx8347d spi32766.0: Device tree data available.
fb_hx8347d spi32766.0: buswidth read properly, value: 8
fb_hx8347d spi32766.0: reset pin read properly, value: 66
fb_hx8347d spi32766.0: dc pin read properly, value: 67
random: nonblocking pool is initialized
graphics fb0: fb_hx8347d frame buffer, 320x240, 150 KiB video memory, 4 KiB DMA buffer memory, fps=21, spi32766.0 at 25 MHz

But I receive an error when I run:
root@arietta:~# modprobe fbtft_device name=mi0283qt-2 cs=0
ERROR: could not insert 'fbtft_device': Invalid argument

fbtft_device: SPI devices registered:
fbtft_device: fb_hx8347d spi32766.0 25000kHz 8 bits mode=0x00
fbtft_device: spidev spi32766.1 25000kHz 8 bits mode=0x03
fbtft_device: 'fb' Platform devices registered:
fbtft_device: spi_busnum_to_master(0) returned NULL
fbtft_device: failed to register SPI device

And "cat /dev/urandom > /dev/fb0" have no result on the LCD.

@nzmichaelh I modified the dts file like yours but without success.

Where am I wrong?
TIA
Clemente

@nzmichaelh

This comment has been minimized.

Show comment
Hide comment
@nzmichaelh

nzmichaelh Jul 19, 2014

Contributor

@cledic I'm not sure, sorry. The frequency is good, you've remapped d and r to other pins which is good. The modprobe line is wrong as the bus is 32766, not 0, but that doesn't matter as it's already been loaded via the Device Tree.

To be clear, I'm not using the Device Tree patch. Sorry for hijacking the thread. The DTS and module options above work just fine with stock Arietta kernel and stock fbtft.

I'd put a scope on the lines next.

Contributor

nzmichaelh commented Jul 19, 2014

@cledic I'm not sure, sorry. The frequency is good, you've remapped d and r to other pins which is good. The modprobe line is wrong as the bus is 32766, not 0, but that doesn't matter as it's already been loaded via the Device Tree.

To be clear, I'm not using the Device Tree patch. Sorry for hijacking the thread. The DTS and module options above work just fine with stock Arietta kernel and stock fbtft.

I'd put a scope on the lines next.

@erazor83

This comment has been minimized.

Show comment
Hide comment
@erazor83

erazor83 Jul 24, 2014

Well, I just testet the arietta with a nokia3310 and things seem to work.

I've done this:

  • download latest kernel from kernel.org
  • apply acme.patch (see website)
  • checkout fbtft and add lines to Makefile + Kconfig (see fbtft doc)
  • created custom dts: http://pastebin.com/WH3QiJJc (make sure noone uses spi dev 0)
  • make modules; make zImage, make xyz.dtb
  • copy everything to arietta
  • modprobe fbtft_device name=nokia3310 busnum=32766 gpios=reset:68,dc:95 speed=5000000

The only issue I have seems to be the contrast of the display. Does anyone know how to change this?

erazor83 commented Jul 24, 2014

Well, I just testet the arietta with a nokia3310 and things seem to work.

I've done this:

  • download latest kernel from kernel.org
  • apply acme.patch (see website)
  • checkout fbtft and add lines to Makefile + Kconfig (see fbtft doc)
  • created custom dts: http://pastebin.com/WH3QiJJc (make sure noone uses spi dev 0)
  • make modules; make zImage, make xyz.dtb
  • copy everything to arietta
  • modprobe fbtft_device name=nokia3310 busnum=32766 gpios=reset:68,dc:95 speed=5000000

The only issue I have seems to be the contrast of the display. Does anyone know how to change this?

@notro

This comment has been minimized.

Show comment
Hide comment
@notro

notro Jul 24, 2014

Owner

The only issue I have seems to be the contrast of the display. Does anyone know how to change this?

The gamma= argument to fbtft_device is used in this driver to control contrast.
Default is gamma=40, the value is masked with 0x7F: https://github.com/notro/fbtft/blob/master/fb_pcd8544.c#L139

Owner

notro commented Jul 24, 2014

The only issue I have seems to be the contrast of the display. Does anyone know how to change this?

The gamma= argument to fbtft_device is used in this driver to control contrast.
Default is gamma=40, the value is masked with 0x7F: https://github.com/notro/fbtft/blob/master/fb_pcd8544.c#L139

@erazor83

This comment has been minimized.

Show comment
Hide comment
@erazor83

erazor83 Jul 24, 2014

echo 20 > /sys/class/graphics/fb0/gamma also works, thanks for the hint!

erazor83 commented Jul 24, 2014

echo 20 > /sys/class/graphics/fb0/gamma also works, thanks for the hint!

@notro

This comment has been minimized.

Show comment
Hide comment
@notro

notro Nov 24, 2014

Owner

Closing issue since there has been no activity for more than 2 months. Reopen if needed.

Owner

notro commented Nov 24, 2014

Closing issue since there has been no activity for more than 2 months. Reopen if needed.

@notro notro closed this Nov 24, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment