Loading arch/arm/boot/dts/qcom/sa415m-ccard.dtsi +2 −3 Original line number Diff line number Diff line /* Copyright (c) 2019, The Linux Foundation. All rights reserved. /* Copyright (c) 2019-2020, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -51,8 +51,7 @@ &i2c_4 { asm330@6a { reg = <0x6b>; pinctrl-names = "default"; pinctrl-0 = <&sensor_enable_default>; asm330-enable-gpio = <&tlmm 90 0x1>; }; }; Loading arch/arm/boot/dts/qcom/sdxpoorwills-pinctrl.dtsi +2 −2 Original line number Diff line number Diff line /* Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. /* Copyright (c) 2017-2020, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -1762,7 +1762,7 @@ pins = "gpio90"; bias-pull-up; drive-strength = <16>; output-high; output-low; }; }; }; Loading drivers/iio/imu/st_asm330lhh/st_asm330lhh.h +1 −0 Original line number Diff line number Diff line Loading @@ -237,6 +237,7 @@ struct st_asm330lhh_hw { const struct st_asm330lhh_transfer_function *tf; struct st_asm330lhh_transfer_buffer tb; int enable_gpio; }; extern const struct dev_pm_ops st_asm330lhh_pm_ops; Loading drivers/iio/imu/st_asm330lhh/st_asm330lhh_core.c +19 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ #include <linux/pm.h> #include <linux/version.h> #include <linux/of.h> #include <linux/of_gpio.h> #include <linux/platform_data/st_sensors_pdata.h> Loading Loading @@ -68,6 +69,9 @@ #define ST_ASM330LHH_TEMP_FS_GAIN (1000000 / ST_ASM330LHH_TEMP_GAIN) #define ST_ASM330LHH_OFFSET (6400) /**Turn on of sensor in ms*/ #define ST_ASM330LHH_TURN_ON_TIME 35 struct st_asm330lhh_std_entry { u16 odr; u8 val; Loading Loading @@ -1028,6 +1032,7 @@ int st_asm330lhh_probe(struct device *dev, int irq, const struct st_asm330lhh_transfer_function *tf_ops) { struct st_asm330lhh_hw *hw; struct device_node *np; int i, err; hw = devm_kzalloc(dev, sizeof(*hw), GFP_KERNEL); Loading @@ -1042,6 +1047,20 @@ int st_asm330lhh_probe(struct device *dev, int irq, hw->dev = dev; hw->irq = irq; hw->tf = tf_ops; np = hw->dev->of_node; hw->enable_gpio = of_get_named_gpio(np, "asm330-enable-gpio", 0); if (gpio_is_valid(hw->enable_gpio)) { err = gpio_request(hw->enable_gpio, "asm330_enable"); if (err < 0) { dev_err(hw->dev, "failed to request gpio %d: %d\n", hw->enable_gpio, err); return err; } gpio_direction_output(hw->enable_gpio, 1); msleep(ST_ASM330LHH_TURN_ON_TIME); } dev_info(hw->dev, "Ver: %s\n", ST_ASM330LHH_VERSION); err = st_asm330lhh_check_whoami(hw); Loading Loading
arch/arm/boot/dts/qcom/sa415m-ccard.dtsi +2 −3 Original line number Diff line number Diff line /* Copyright (c) 2019, The Linux Foundation. All rights reserved. /* Copyright (c) 2019-2020, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -51,8 +51,7 @@ &i2c_4 { asm330@6a { reg = <0x6b>; pinctrl-names = "default"; pinctrl-0 = <&sensor_enable_default>; asm330-enable-gpio = <&tlmm 90 0x1>; }; }; Loading
arch/arm/boot/dts/qcom/sdxpoorwills-pinctrl.dtsi +2 −2 Original line number Diff line number Diff line /* Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. /* Copyright (c) 2017-2020, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -1762,7 +1762,7 @@ pins = "gpio90"; bias-pull-up; drive-strength = <16>; output-high; output-low; }; }; }; Loading
drivers/iio/imu/st_asm330lhh/st_asm330lhh.h +1 −0 Original line number Diff line number Diff line Loading @@ -237,6 +237,7 @@ struct st_asm330lhh_hw { const struct st_asm330lhh_transfer_function *tf; struct st_asm330lhh_transfer_buffer tb; int enable_gpio; }; extern const struct dev_pm_ops st_asm330lhh_pm_ops; Loading
drivers/iio/imu/st_asm330lhh/st_asm330lhh_core.c +19 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ #include <linux/pm.h> #include <linux/version.h> #include <linux/of.h> #include <linux/of_gpio.h> #include <linux/platform_data/st_sensors_pdata.h> Loading Loading @@ -68,6 +69,9 @@ #define ST_ASM330LHH_TEMP_FS_GAIN (1000000 / ST_ASM330LHH_TEMP_GAIN) #define ST_ASM330LHH_OFFSET (6400) /**Turn on of sensor in ms*/ #define ST_ASM330LHH_TURN_ON_TIME 35 struct st_asm330lhh_std_entry { u16 odr; u8 val; Loading Loading @@ -1028,6 +1032,7 @@ int st_asm330lhh_probe(struct device *dev, int irq, const struct st_asm330lhh_transfer_function *tf_ops) { struct st_asm330lhh_hw *hw; struct device_node *np; int i, err; hw = devm_kzalloc(dev, sizeof(*hw), GFP_KERNEL); Loading @@ -1042,6 +1047,20 @@ int st_asm330lhh_probe(struct device *dev, int irq, hw->dev = dev; hw->irq = irq; hw->tf = tf_ops; np = hw->dev->of_node; hw->enable_gpio = of_get_named_gpio(np, "asm330-enable-gpio", 0); if (gpio_is_valid(hw->enable_gpio)) { err = gpio_request(hw->enable_gpio, "asm330_enable"); if (err < 0) { dev_err(hw->dev, "failed to request gpio %d: %d\n", hw->enable_gpio, err); return err; } gpio_direction_output(hw->enable_gpio, 1); msleep(ST_ASM330LHH_TURN_ON_TIME); } dev_info(hw->dev, "Ver: %s\n", ST_ASM330LHH_VERSION); err = st_asm330lhh_check_whoami(hw); Loading