Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  * Copyright (C) 2011 Kionix, Inc.
0004  * Written by Chris Hudson <chudson@kionix.com>
0005  */
0006 
0007 #ifndef __KXTJ9_H__
0008 #define __KXTJ9_H__
0009 
0010 #define KXTJ9_I2C_ADDR      0x0F
0011 
0012 struct kxtj9_platform_data {
0013     unsigned int min_interval;  /* minimum poll interval (in milli-seconds) */
0014     unsigned int init_interval; /* initial poll interval (in milli-seconds) */
0015 
0016     /*
0017      * By default, x is axis 0, y is axis 1, z is axis 2; these can be
0018      * changed to account for sensor orientation within the host device.
0019      */
0020     u8 axis_map_x;
0021     u8 axis_map_y;
0022     u8 axis_map_z;
0023 
0024     /*
0025      * Each axis can be negated to account for sensor orientation within
0026      * the host device.
0027      */
0028     bool negate_x;
0029     bool negate_y;
0030     bool negate_z;
0031 
0032     /* CTRL_REG1: set resolution, g-range, data ready enable */
0033     /* Output resolution: 8-bit valid or 12-bit valid */
0034     #define RES_8BIT        0
0035     #define RES_12BIT       (1 << 6)
0036     u8 res_12bit;
0037     /* Output g-range: +/-2g, 4g, or 8g */
0038     #define KXTJ9_G_2G      0
0039     #define KXTJ9_G_4G      (1 << 3)
0040     #define KXTJ9_G_8G      (1 << 4)
0041     u8 g_range;
0042 
0043     int (*init)(void);
0044     void (*exit)(void);
0045     int (*power_on)(void);
0046     int (*power_off)(void);
0047 };
0048 #endif  /* __KXTJ9_H__ */