notro / fbtft_tools

27 stars 17 forks source link

It looks like they changed the CONFIG_ARCH_ name on newer kernels #12

Open hamishcoleman opened 7 years ago

hamishcoleman commented 7 years ago

I only patched the gpio_keys_device.c because that is the only tool I tested

notro commented 7 years ago

I'm not sure what to do with this, because it will only work on Pi1 always setting #define BCM2708_PERI_BASE 0x20000000. Compiled for a Pi2/3 it will use the wrong address. From 4.9 on only CONFIG_ARCH_BCM2835 exists and the Device Tree tells which model it is.

The preferred way to use gpiokeys now is to use a Device Tree overlay. Here's an example: https://github.com/raspberrypi/linux/blob/rpi-4.9.y/arch/arm/boot/dts/overlays/tinylcd35-overlay.dts

hamishcoleman commented 7 years ago

Yeah - once I had found the code and saw what the fix was, I started looking for some simple device-tree answer.

While I can see that a device tree overlay is the 'right' answer, it is surely a much more annoying answer to use to stuff around with various options.

If I get a chance, I will look further for a different patch that uses something like of_find_node_by_name() to get the defined gpio base address.