Skip to content

motorola-ali: Additional functionality #225

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 7 commits into
base: 6.13/main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 45 additions & 18 deletions arch/arm64/boot/dts/qcom/msm8953.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
81 changes: 73 additions & 8 deletions arch/arm64/boot/dts/qcom/sdm450-motorola-ali.dts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down Expand Up @@ -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>;
Expand All @@ -143,6 +191,18 @@
status = "okay";
};

&pmi8950_haptics {
qcom,actuator-type = <HAP_TYPE_LRA>;
qcom,auto-res-mode = <HAP_AUTO_RES_NONE>;
qcom,brake-pattern = <0x3 0x3 0x2 0x0>;
qcon,play-mode = <HAP_PLAY_DIRECT>;
qcom,vmax-millivolt = <2500>;
qcom,wave-play-rate-us = <4255>;
qcom,wave-shape = <HAP_WAVE_SINE>;

status = "okay";
};

&pmi8950_smbcharger {
monitored-battery = <&battery>;
status = "okay";
Expand Down Expand Up @@ -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";
};

Expand All @@ -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;
};
};
Expand Down
2 changes: 2 additions & 0 deletions drivers/iio/imu/bmi160/bmi160_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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, \
Expand Down Expand Up @@ -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);
Expand Down