On Wed, Mar 2, 2016 at 1:22 PM, Drew Fustini <[email protected]> wrote:
> I'm trying to get the ADXL345 accelerometer working with the adxl345
> input kernel driver, but I'm confused about what interrupt number to
> specify for it
>
> I'm using a BeagleBone Green with the Grove 3-Axis Digital
> Accelerometer (SKU: 101020054):
> http://www.seeedstudio.com/wiki/Grove_-_3-Axis_Digital_Accelerometer_ADXL345
>
> The BBG is running Linux 4.5-rc4 built with Robert's linux-dev scripts:
> https://github.com/RobertCNelson/linux-dev
>
> For reference, this is the ADXL345 userspace library from Seeed:
> https://github.com/Seeed-Studio/Accelerometer_ADXL345
>
> I'm using this information from the Analog Devices wiki:
> ADXL345 Input 3-Axis Digital Accelerometer Linux Driver:
> https://wiki.analog.com/resources/tools-software/linux-drivers/input-misc/adxl345
>
> I created this Device Tree Overlay based on that wiki page:
> https://gist.github.com/pdp7/cd47cdc2a6747c8b01a5#device-tree-overlay
>
> However, I am uncertain what value to use for "interrupts":
>
>             adxl345@0 {
>                 compatible = "adi,adxl345";
>                 reg = <0x53>;
>                 interrupt-parent = <&gpio3>;
>                 interrupts = <19 0x0>;
>             };
>
> I load the overlay and driver as shown in this Gist:
> https://gist.github.com/pdp7/cd47cdc2a6747cb01a5#load-driver

Here's how i've done this:

Define a pinmux:

https://github.com/RobertCNelson/dtb-rebuilder/blob/4.1-ti/src/arm/am335x-cape-bbb-exp-c.dtsi#L47-L52

BONE_P9_23 (PIN_INPUT_PULLDOWN | MUX_MODE7) /* gpmc_a1.gpio1_17 */

Then in the i2c device node:

pinmux reference:

pinctrl-names = "default";
pinctrl-0 = <&edt_ft5306_ts_pins>;

Then the irq stuff:

interrupt-parent = <&gpio1>; /* gpio1_17 is on &gpio1 */
interrupts = <17 0>; /* 17 fro gpio1_17, 0 is active high */

https://github.com/RobertCNelson/dtb-rebuilder/blob/4.1-ti/src/arm/am335x-cape-bbb-exp-c.dtsi#L90-L102

https://github.com/RobertCNelson/dtb-rebuilder/blob/4.1-ti/include/dt-bindings/gpio/gpio.h

Regards,

-- 
Robert Nelson
https://rcn-ee.com/

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to