Hi Éric, On Sun, Dec 08, 2013 at 02:27:52PM +0100, Éric Piel wrote: > On 03-12-13 13:21, Sebastian Reichel wrote: > >The lis302 has already a DT binding described in [0], > >which descibes misc. hardware properties. The problem > >is, that the Nokia N900 needs negative values for some > >of the properties, which seem to be unsupported by DT. > >The following values would be needed for the N900 (taken > >from board code): > > > >st,axis-x = <1>; /* LIS3_DEV_X */ > >st,axis-y = <-2>; /* LIS3_INV_DEV_Y */ > >st,axis-z = <-3>; /* LIS3_INV_DEV_Z */ > > > >st,min-limit-x = <-32>; > >st,min-limit-y = <3>; > >st,min-limit-z = <3>; > > > >st,max-limit-x = <-3>; > >st,max-limit-y = <32>; > >st,max-limit-z = <32>; > > > >Can you please tell me how to setup the properties correctly? > > The code to support inversion of the axis is there... but apparently > only in the I2C code. It seems the SPI code doesn't (yet) use any of > these values. Is the accelerometer on the N900 connected via SPI, by > chance? No, it's connected via I2C. Please note, that the N900's accelerometer is already supported, but only when initialized via legacy boardcode. The problem is, that I can't specify negative values in the device tree file (the device tree compiler complains). I couldn't find any example of negative numbers in any dts file, so I guess, that negative numbers are not supported. > It should be pretty simple to extend the SPI driver to support axis > conversion too. It'd basically be a copy-paste of > lis3lv02d_i2c_probe() > > Concerning {min,max}-limit-*, I only have vague understanding of > this information (only used in self test), but it should already be > working fine with both I2C and SPI (as it's bus independent). In > addition, note that it's compared to raw data (i.e., before axis > conversion), so you probably don't need to put negative values > there. I just want to port the existing boardcode to device tree. The existing platform data is defined as rx51_lis3lv02d_data in arch/arm/mach-omap2/board-rx51-peripherals.c. -- Sebastian
Attachment:
signature.asc
Description: Digital signature