diff --git a/arch/arm64/boot/dts/qcom/msm8953.dtsi b/arch/arm64/boot/dts/qcom/msm8953.dtsi index 86bfc2ab40900b..9d2935493d92d2 100644 --- a/arch/arm64/boot/dts/qcom/msm8953.dtsi +++ b/arch/arm64/boot/dts/qcom/msm8953.dtsi @@ -1370,45 +1370,72 @@ }; spi_3_default: spi-3-default-state { - pins = "gpio10", "gpio11"; - function = "blsp_spi3"; - drive-strength = <2>; - bias-disable; + spi-pins { + pins = "gpio8", "gpio9", "gpio11"; + function = "blsp_spi3"; + drive-strength = <12>; + bias-disable; + }; + cs-pins { + pins = "gpio10"; + function = "gpio"; + drive-strength = <16>; + bias-disable; + output-high; + }; }; spi_3_sleep: spi-3-sleep-state { - pins = "gpio10", "gpio11"; + pins = "gpio8", "gpio9", "gpio10", "gpio11"; function = "gpio"; drive-strength = <2>; - bias-disable; + bias-pull-down; }; spi_5_default: spi-5-default-state { - pins = "gpio18", "gpio19"; - function = "blsp_spi5"; - drive-strength = <2>; - bias-disable; + spi-pins { + pins = "gpio16", "gpio17", "gpio19"; + function = "blsp_spi5"; + drive-strength = <12>; + bias-disable; + }; + cs-pins { + pins = "gpio18"; + function = "gpio"; + drive-strength = <16>; + bias-disable; + output-high; + }; }; spi_5_sleep: spi-5-sleep-state { - pins = "gpio18", "gpio19"; + pins = "gpio16", "gpio17", "gpio18", "gpio19"; function = "gpio"; drive-strength = <2>; - bias-disable; + bias-pull-down; }; spi_6_default: spi-6-default-state { - pins = "gpio22", "gpio23"; - function = "blsp_spi6"; - drive-strength = <2>; - bias-disable; + spi-pins { + pins = "gpio20", "gpio21", "gpio23"; + function = "blsp_spi6"; + drive-strength = <12>; + bias-disable; + }; + cs-pins { + pins = "gpio22"; + function = "gpio"; + drive-strength = <16>; + bias-disable; + output-high; + }; }; spi_6_sleep: spi-6-sleep-state { - pins = "gpio22", "gpio23"; + pins = "gpio20", "gpio21", "gpio22", "gpio23"; function = "gpio"; drive-strength = <2>; - bias-disable; + bias-pull-down; }; wcnss_pin_a: wcnss-active-state { diff --git a/arch/arm64/boot/dts/qcom/sdm450-motorola-ali.dts b/arch/arm64/boot/dts/qcom/sdm450-motorola-ali.dts index ef92f30fca8a32..ffc6652abd1de3 100644 --- a/arch/arm64/boot/dts/qcom/sdm450-motorola-ali.dts +++ b/arch/arm64/boot/dts/qcom/sdm450-motorola-ali.dts @@ -55,6 +55,52 @@ regulator-always-on; regulator-boot-on; }; + + i2c-gpio { + compatible = "i2c-gpio"; + sda-gpios = <&tlmm 14 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; + scl-gpios = <&tlmm 15 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; + i2c-gpio,delay-us = <2>; /* ~100 kHz */ + #address-cells = <1>; + #size-cells = <0>; + + ak09918: magnetometer@c { + compatible = "asahi-kasei,ak09918"; + reg = <0x0c>; + + vdd-supply = <&pm8953_l10>; + vid-supply = <&pm8953_l6>; + }; + }; + + spi6-gpio { + compatible = "spi-gpio"; + #address-cells = <1>; + #size-cells = <0>; + + sck-gpios = <&tlmm 23 GPIO_ACTIVE_HIGH>; + mosi-gpios = <&tlmm 20 GPIO_ACTIVE_HIGH>; + miso-gpios = <&tlmm 21 GPIO_ACTIVE_HIGH>; + num-chipselects = <1>; + cs-gpios = <&tlmm 22 GPIO_ACTIVE_LOW>; + + imu@0 { + compatible = "bosch,bmi160"; + reg = <0>; + spi-max-frequency = <10000000>; + interrupt-parent = <&tlmm>; + interrupts = <42 IRQ_TYPE_EDGE_RISING>, + <45 IRQ_TYPE_EDGE_RISING>; + interrupt-names = "INT1", "INT2"; + + vdd-supply = <&pm8953_l10>; + vddio-supply = <&pm8953_l6>; + + mount-matrix = "0", "1", "0", + "1", "0", "0", + "0", "0", "1"; + }; + }; }; &mdss { @@ -76,9 +122,9 @@ vsn-supply = <&ibb_vreg>; reset-gpios = <&tlmm 61 GPIO_ACTIVE_LOW>; - pinctrl-names = "default"; pinctrl-0 = <&pmx_mdss_default>; pinctrl-1 = <&pmx_mdss_sleep>; + pinctrl-names = "default"; port { panel_in: endpoint { @@ -121,10 +167,12 @@ reg = <0x38>; interrupt-parent = <&tlmm>; interrupts = <65 IRQ_TYPE_EDGE_FALLING>; + vcc-supply = <&pm8953_l10>; + iovcc-supply = <&pm8953_l6>; + pinctrl-0 = <&ts_reset_default &ts_int_default>; pinctrl-names = "default"; - pinctrl-0 = <&ts_int_active &ts_reset_active>; reset-gpios = <&tlmm 64 GPIO_ACTIVE_LOW>; touchscreen-size-x = <1080>; @@ -143,6 +191,18 @@ status = "okay"; }; +&pmi8950_haptics { + qcom,actuator-type = ; + qcom,auto-res-mode = ; + qcom,brake-pattern = <0x3 0x3 0x2 0x0>; + qcon,play-mode = ; + qcom,vmax-millivolt = <2500>; + qcom,wave-play-rate-us = <4255>; + qcom,wave-shape = ; + + status = "okay"; +}; + &pmi8950_smbcharger { monitored-battery = <&battery>; status = "okay"; @@ -288,10 +348,14 @@ cd-gpios = <&tlmm 133 GPIO_ACTIVE_LOW>; - pinctrl-names = "default", "sleep"; pinctrl-0 = <&sdc2_clk_on &sdc2_cmd_on &sdc2_data_on &sdc2_cd_off>; pinctrl-1 = <&sdc2_clk_off &sdc2_cmd_off &sdc2_data_off &sdc2_cd_off>; + pinctrl-names = "default", "sleep"; + + status = "okay"; +}; +&atc_leds { status = "okay"; }; @@ -313,17 +377,18 @@ bias-pull-down; }; - ts_int_active: ts-int-active-state { + ts_int_default: ts-int-default-state { pins = "gpio65"; function = "gpio"; - drive-strength = <8>; - bias-pull-up; + drive-strength = <16>; + input-enable; + bias-disable; }; - ts_reset_active: ts-reset-active-state { + ts_reset_default: ts-reset-default-state { pins = "gpio64"; function = "gpio"; - drive-strength = <0x08>; + drive-strength = <8>; bias-pull-up; }; }; diff --git a/drivers/iio/imu/bmi160/bmi160_core.c b/drivers/iio/imu/bmi160/bmi160_core.c index 0423ef6f9571e5..df878bbcc9851e 100644 --- a/drivers/iio/imu/bmi160/bmi160_core.c +++ b/drivers/iio/imu/bmi160/bmi160_core.c @@ -95,6 +95,7 @@ #define BMI160_ACCEL_PMU_MIN_USLEEP 3800 #define BMI160_GYRO_PMU_MIN_USLEEP 80000 #define BMI160_SOFTRESET_USLEEP 1000 +#define BMI160_SPI_MODE_CHANGE_USLEEP 1000 #define BMI160_CHANNEL(_type, _axis, _index) { \ .type = _type, \ @@ -736,6 +737,7 @@ static int bmi160_chip_init(struct bmi160_data *data, bool use_spi) ret = regmap_read(data->regmap, BMI160_REG_DUMMY, &val); if (ret) goto disable_regulator; + usleep_range(BMI160_SPI_MODE_CHANGE_USLEEP, BMI160_SPI_MODE_CHANGE_USLEEP + 1); } ret = regmap_read(data->regmap, BMI160_REG_CHIP_ID, &val);