boards: frdm_kl25z: use fxos8700 driver for MMA8451

Use fxos8700 driver for MMA8451 accelerometer.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
This commit is contained in:
Johann Fischer 2018-09-26 17:19:26 +02:00 committed by Maureen Helm
commit 8a16fa400c
3 changed files with 12 additions and 4 deletions

View file

@ -4,6 +4,8 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
#define CONFIG_MMA8451Q_NAME NXP_KINETIS_I2C_40066000_NXP_MMA8451Q_1D_LABEL #define CONFIG_FXOS8700_NAME NXP_KINETIS_I2C_40066000_NXP_FXOS8700_1D_LABEL
#define CONFIG_MMA8451Q_I2C_NAME NXP_KINETIS_I2C_40066000_NXP_MMA8451Q_1D_BUS_NAME #define CONFIG_FXOS8700_I2C_NAME NXP_KINETIS_I2C_40066000_NXP_FXOS8700_1D_BUS_NAME
#define CONFIG_MMA8451Q_I2C_ADDRESS NXP_KINETIS_I2C_40066000_NXP_MMA8451Q_1D_BASE_ADDRESS #define CONFIG_FXOS8700_I2C_ADDRESS NXP_KINETIS_I2C_40066000_NXP_FXOS8700_1D_BASE_ADDRESS
#define CONFIG_FXOS8700_GPIO_NAME NXP_KINETIS_I2C_40066000_NXP_FXOS8700_1D_INT2_GPIOS_CONTROLLER
#define CONFIG_FXOS8700_GPIO_PIN NXP_KINETIS_I2C_40066000_NXP_FXOS8700_1D_INT2_GPIOS_PIN

View file

@ -65,9 +65,11 @@
&i2c0 { &i2c0 {
status = "ok"; status = "ok";
mma8451q@1d { mma8451q@1d {
compatible = "nxp,mma8451q"; compatible = "nxp,fxos8700","nxp,mma8451q";
reg = <0x1d>; reg = <0x1d>;
label = "MMA8451Q"; label = "MMA8451Q";
int1-gpios = <&gpioa 14 0>;
int2-gpios = <&gpioa 15 0>;
}; };
}; };

View file

@ -48,6 +48,10 @@ static int frdm_kl25z_pinmux_init(struct device *dev)
pinmux_pin_set(portb, 18, PORT_PCR_MUX(kPORT_MuxAsGpio)); pinmux_pin_set(portb, 18, PORT_PCR_MUX(kPORT_MuxAsGpio));
pinmux_pin_set(portb, 19, PORT_PCR_MUX(kPORT_MuxAsGpio)); pinmux_pin_set(portb, 19, PORT_PCR_MUX(kPORT_MuxAsGpio));
/* MMA8451 INT1, INT2 */
pinmux_pin_set(porta, 14, PORT_PCR_MUX(kPORT_MuxAsGpio));
pinmux_pin_set(porta, 15, PORT_PCR_MUX(kPORT_MuxAsGpio));
#if defined(CONFIG_I2C_0) #if defined(CONFIG_I2C_0)
/* I2C0 SCL, SDA */ /* I2C0 SCL, SDA */
pinmux_pin_set(porte, 24, PORT_PCR_MUX(kPORT_MuxAlt5) pinmux_pin_set(porte, 24, PORT_PCR_MUX(kPORT_MuxAlt5)