From patchwork Sat Apr 6 11:14:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raymond Hackley X-Patchwork-Id: 13619777 Received: from mail-40141.protonmail.ch (mail-40141.protonmail.ch [185.70.40.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B512F2C183; Sat, 6 Apr 2024 11:14:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.70.40.141 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712402085; cv=none; b=LDeu1Fm9R/LrYD2BQAdniEvuaiHkP4etK6kzykyoIrHYZwO+nNmNBHwCyqQapFA3ZlHtIbTE7h5mg8RkkpYeRcBd2SpW1NAI4EyQasulpjpE9u16Rc61XOPpYBQBaEnil6SAit/70Njb1GEzeK5/f8Nqb6jEoSeESk6Iz95e/nM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712402085; c=relaxed/simple; bh=a47454EdCwraOlJHbDpA8w0pS4WuEE+DQis9OxZ5xXg=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=sQGZ//W6cqcaFyFDv9zz/DsXIACeujqUdrLPwoON7L8XbWOQZLxFiv0zMJIk+Hn+PWzOMmre10maWeC1ozv/f4RcLJ1JEwqG/oaiGxFflg9NEqk4tXAqkMK15bchir9PlMEfoqejj8ufj1I52AyG6c0VFS/y6niY8ITEiq1oUXk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=protonmail.com; spf=pass smtp.mailfrom=protonmail.com; dkim=pass (2048-bit key) header.d=protonmail.com header.i=@protonmail.com header.b=IPleJqVs; arc=none smtp.client-ip=185.70.40.141 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=protonmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=protonmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=protonmail.com header.i=@protonmail.com header.b="IPleJqVs" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1712402075; x=1712661275; bh=zZR/8orMxcDNlLMhBF0vomamSOmdppTI1jFoJaHA6aE=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=IPleJqVsW/8SjueG0qNvebgleaGFMmydZmcM5xg+K/4mBZpyZMvewEbJKWjLAPmQA eKx0yAvT1YBf3p2rS9lDx9mNWho62UyjDOJOokw2iFr+BsioxuHLBPizCseotVsIcj ANyDgX8eu/Vcr7J3jTm0LT/H4su5whlwmrrZ1MXTQFD6xXwarM90nQChroA5ibnG3m fotSo5nc3hSG0K49lPqNZjfwUDrXSfZ4QMRlHCy11L9NMrIyQizEfGw5/+EvuCrQ5m kSsSFIVYCuj9JC+zH7Ujj/Fnby4TO/rhLFTbieMDodrmItTQjm9JlvDg0t7/03v02F jYiWa0w2EZLIQ== Date: Sat, 06 Apr 2024 11:14:28 +0000 To: linux-kernel@vger.kernel.org From: Raymond Hackley Cc: Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Stephan Gerhold , Nikita Travkin , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, Joe Mason Subject: [PATCH v2 1/3] arm64: dts: qcom: msm8916-samsung-fortuna: Add BMC150 accelerometer/magnetometer Message-ID: <20240406111348.14358-2-raymondhackley@protonmail.com> In-Reply-To: <20240406111348.14358-1-raymondhackley@protonmail.com> References: <20240406111348.14358-1-raymondhackley@protonmail.com> Feedback-ID: 49437091:user:proton Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Joe Mason Some Grand Prime use a Bosch BMC150 accelerometer/magnetometer combo. The chip provides two separate I2C devices for the accelerometer and magnetometer that are already supported by the bmc150-accel and bmc150-magn driver. Signed-off-by: Joe Mason [Stephan: Move sensors to common dtsi, disabled by default] Signed-off-by: Stephan Gerhold [Raymond: Add it to grandprimelte. Use interrupts-extended] Signed-off-by: Raymond Hackley --- .../qcom/msm8916-samsung-fortuna-common.dtsi | 44 +++++++++++++++++++ .../dts/qcom/msm8916-samsung-gprimeltecan.dts | 8 ++++ .../qcom/msm8916-samsung-grandprimelte.dts | 8 ++++ 3 files changed, 60 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-fortuna-common.dtsi b/arch/arm64/boot/dts/qcom/msm8916-samsung-fortuna-common.dtsi index 5e933fb8b363..b6e1fe8b0056 100644 --- a/arch/arm64/boot/dts/qcom/msm8916-samsung-fortuna-common.dtsi +++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-fortuna-common.dtsi @@ -117,6 +117,43 @@ muic: extcon@25 { }; }; +&blsp_i2c2 { + /* Available sensors vary depending on model variant */ + status = "okay"; + + bosch_accel: accelerometer@10 { + compatible = "bosch,bmc150_accel"; + reg = <0x10>; + interrupts-extended = <&tlmm 115 IRQ_TYPE_EDGE_RISING>; + + vdd-supply = <&pm8916_l5>; + vddio-supply = <&pm8916_l5>; + + pinctrl-0 = <&accel_int_default>; + pinctrl-names = "default"; + + mount-matrix = "0", "-1", "0", + "-1", "0", "0", + "0", "0", "1"; + + status = "disabled"; + }; + + bosch_magn: magnetometer@12 { + compatible = "bosch,bmc150_magn"; + reg = <0x12>; + + vdd-supply = <&pm8916_l5>; + vddio-supply = <&pm8916_l5>; + + mount-matrix = "0", "-1", "0", + "-1", "0", "0", + "0", "0", "1"; + + status = "disabled"; + }; +}; + &blsp_i2c4 { status = "okay"; @@ -223,6 +260,13 @@ &wcnss_mem { }; &tlmm { + accel_int_default: accel-int-default-state { + pins = "gpio115"; + function = "gpio"; + drive-strength = <2>; + bias-disable; + }; + backlight_en_default: backlight-en-default-state { pins = "gpio98"; function = "gpio"; diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-gprimeltecan.dts b/arch/arm64/boot/dts/qcom/msm8916-samsung-gprimeltecan.dts index 9d65fa58ba92..4dc74e8bf1d8 100644 --- a/arch/arm64/boot/dts/qcom/msm8916-samsung-gprimeltecan.dts +++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-gprimeltecan.dts @@ -21,6 +21,14 @@ tz-apps@85500000 { }; }; +&bosch_accel { + status = "okay"; +}; + +&bosch_magn { + status = "okay"; +}; + &mpss_mem { /* Firmware for gprimeltecan needs more space */ reg = <0x0 0x86800000 0x0 0x5400000>; diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-grandprimelte.dts b/arch/arm64/boot/dts/qcom/msm8916-samsung-grandprimelte.dts index a66ce4b13547..cffad734c4df 100644 --- a/arch/arm64/boot/dts/qcom/msm8916-samsung-grandprimelte.dts +++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-grandprimelte.dts @@ -10,6 +10,14 @@ / { chassis-type = "handset"; }; +&bosch_accel { + status = "okay"; +}; + +&bosch_magn { + status = "okay"; +}; + &mpss_mem { /* Firmware for grandprimelte needs more space */ reg = <0x0 0x86800000 0x0 0x5400000>; From patchwork Sat Apr 6 11:14:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raymond Hackley X-Patchwork-Id: 13619778 Received: from mail-40130.protonmail.ch (mail-40130.protonmail.ch [185.70.40.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 66A0F2C1A6 for ; Sat, 6 Apr 2024 11:14:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.70.40.130 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712402100; cv=none; b=qGAheQc3fAdG1j04owRH6/LBGU1q2MdU/HFghqVFHBSRtzAn3SV7aV3mU6aJoSZ1Stf6mzTUrgQaqKXJ1gfW4F7eN5cBTyF5RTq/ujOTg+SsFCnSZHMmT40qaGr6DeK8PgyOP69cwnb7Zsk7fqnjs5kCR648tt4mvwB4O7Ep3Pg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712402100; c=relaxed/simple; bh=QPouy+txxaEadd0avJYA4wF5PBAXuT97/zgLOuEIY4c=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=cQ1MVhIiaukTPCB5p6Ym98TOPCwTftkXTQ2uX3+WivPj5rEPgDFQuUZMP/Xrwi/Gd+HocIeCGAzAIVNatwF7y+BbYvvV4lC8229IoBmn+1D0tTHVz6GAWS5kRcccmXZGVL34x/IK2kwT1thWf1TIutxa+0ELK8BYuLrAn7ojnNA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=protonmail.com; spf=pass smtp.mailfrom=protonmail.com; dkim=pass (2048-bit key) header.d=protonmail.com header.i=@protonmail.com header.b=Bi96cy62; arc=none smtp.client-ip=185.70.40.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=protonmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=protonmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=protonmail.com header.i=@protonmail.com header.b="Bi96cy62" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1712402090; x=1712661290; bh=LiT0RkSN1jYcw0F40PEh3I31dVargIaYKG8utpP8rWI=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=Bi96cy62m5/WXXOh2IMomjvLWA64PkESFO25kr95ZW5w5bEuD8S1iN1lVR79h5Gz/ n6Uzffs80bTYz7EAOl3IqsCnGBV1RL6azFWwNjYNIVXR2C17X3oaKgBZYUVz3BEYbw UserCgYKKaQvmb2n57nDb9clXvXLuav6+vS3AXf1I88sFE/CbslbdQ17565Cf8/vE+ vmWY20kuUvcN5VwezBVgU592XrFAuaCK5TGfUGgzyEqt8wApKOHTXB4pqF0KdKj8T4 1Tmp5yVoqY3780Ux1bQMs4dfA7+ByElFCBakY7yJc56vo0NMOKtc7NLked95hkf2v9 2Cf6sq3XzBEJQ== Date: Sat, 06 Apr 2024 11:14:45 +0000 To: linux-kernel@vger.kernel.org From: Raymond Hackley Cc: Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Stephan Gerhold , Nikita Travkin , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, Siddharth Manthan Subject: [PATCH v2 2/3] arm64: dts: qcom: msm8916-samsung-fortuna: Add LSM303C accelerometer/magnetometer Message-ID: <20240406111348.14358-3-raymondhackley@protonmail.com> In-Reply-To: <20240406111348.14358-1-raymondhackley@protonmail.com> References: <20240406111348.14358-1-raymondhackley@protonmail.com> Feedback-ID: 49437091:user:proton Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Siddharth Manthan Some Grand Prime use a ST LSM303C accelerometer/magnetometer combo. Add support for it. Signed-off-by: Siddharth Manthan [Stephan: Move sensors to common dtsi (disabled by default)] Signed-off-by: Stephan Gerhold [Raymond: Use interrupts-extended] Signed-off-by: Raymond Hackley --- .../dts/qcom/msm8216-samsung-fortuna3g.dts | 8 +++++ .../qcom/msm8916-samsung-fortuna-common.dtsi | 33 +++++++++++++++++++ 2 files changed, 41 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/msm8216-samsung-fortuna3g.dts b/arch/arm64/boot/dts/qcom/msm8216-samsung-fortuna3g.dts index 366914be7d53..e7f6df229f9a 100644 --- a/arch/arm64/boot/dts/qcom/msm8216-samsung-fortuna3g.dts +++ b/arch/arm64/boot/dts/qcom/msm8216-samsung-fortuna3g.dts @@ -9,3 +9,11 @@ / { compatible = "samsung,fortuna3g", "qcom,msm8916"; chassis-type = "handset"; }; + +&st_accel { + status = "okay"; +}; + +&st_magn { + status = "okay"; +}; diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-fortuna-common.dtsi b/arch/arm64/boot/dts/qcom/msm8916-samsung-fortuna-common.dtsi index b6e1fe8b0056..17d21949dfec 100644 --- a/arch/arm64/boot/dts/qcom/msm8916-samsung-fortuna-common.dtsi +++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-fortuna-common.dtsi @@ -152,6 +152,39 @@ bosch_magn: magnetometer@12 { status = "disabled"; }; + + st_accel: accelerometer@1d { + compatible = "st,lsm303c-accel"; + reg = <0x1d>; + interrupts-extended = <&tlmm 115 IRQ_TYPE_LEVEL_HIGH>; + + vdd-supply = <&pm8916_l17>; + vddio-supply = <&pm8916_l5>; + + pinctrl-0 = <&accel_int_default>; + pinctrl-names = "default"; + + st,drdy-int-pin = <1>; + mount-matrix = "0", "-1", "0", + "1", "0", "0", + "0", "0", "-1"; + + status = "disabled"; + }; + + st_magn: magnetometer@1e { + compatible = "st,lsm303c-magn"; + reg = <0x1e>; + + vdd-supply = <&pm8916_l17>; + vddio-supply = <&pm8916_l5>; + + mount-matrix = "0", "-1", "0", + "1", "0", "0", + "0", "0", "-1"; + + status = "disabled"; + }; }; &blsp_i2c4 { From patchwork Sat Apr 6 11:15:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raymond Hackley X-Patchwork-Id: 13619779 Received: from mail-40137.protonmail.ch (mail-40137.protonmail.ch [185.70.40.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 693A22C6B6; Sat, 6 Apr 2024 11:15:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.70.40.137 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712402113; cv=none; b=ERdcspu0N+HtBc5WeVPQAnNshBSi0UB32Vgm5rxGauFrHd3y8aqawxkP8dlVfwFmmW5S0jLZqgjd1un7LWH+CrXpNHARveeoZ2tQUBaAq4U3mDFt9aowU4smo3YnM1JEp0xxgEAzDJamZ6L0Hp6OzqMz8oUZcArlAKGBOF5asxg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712402113; c=relaxed/simple; bh=Cz/8wfNWWTObsZ/skhto2RRyF2E/E7d1UqsZee0Hmw8=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=tmuY86qd02tOIXhRKRB7S2zsBhtXtw+RYCzhCJZ+52TWTvThbHf0D1Do2gpAmunEE+kPc7UuYb6HfplzkE1bzA9CEfT4x1p4+rW2hrEd/nac3cqDi0IO5SWkoHeyufP/4VUcimRflxC7d/f9ZG++7ZKPSKcFDqPngY8VvQ8HoxE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=protonmail.com; spf=pass smtp.mailfrom=protonmail.com; dkim=pass (2048-bit key) header.d=protonmail.com header.i=@protonmail.com header.b=uURzRbvM; arc=none smtp.client-ip=185.70.40.137 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=protonmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=protonmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=protonmail.com header.i=@protonmail.com header.b="uURzRbvM" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1712402103; x=1712661303; bh=jU5NtiO4Jmo6N6XEhJDq51V29uokcFWXuJa7qaP4spc=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=uURzRbvMm7jxWJYHA/fwrgulAd0/wo5n1txiHo53L8o8zyghV9o4hzPSDJISrraA7 pcxlLzWf6+oh5CvUyMr6m/mEhc5pS6oJ0FvJma8gDyEkl9X5VJThcFpic26u7PT/ic Tnl/5eo4q8cF5I7jWIPwlUFj/wUGMgEgNAgKCLaGeqarlMh8Lj19ArB7f4nve6N7Cv bLHrgLF+JB36m/ZIIEqRJrpbSfoB5n6z1ukwe7Tig7H+vHUzuM8+2MpDUzDZCMrbXd UwHi7yK5WSSpPDy8O93QfHiKDJ5fwzShO8MXYwSsUSp3yWToLg6OTVVNOwb94ZfPi1 eAxtehsX4ok+A== Date: Sat, 06 Apr 2024 11:15:00 +0000 To: linux-kernel@vger.kernel.org From: Raymond Hackley Cc: Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Stephan Gerhold , Nikita Travkin , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht Subject: [PATCH v2 3/3] arm64: dts: qcom: msm8916-samsung-rossa: Add LIS2HH12 accelerometer Message-ID: <20240406111348.14358-4-raymondhackley@protonmail.com> In-Reply-To: <20240406111348.14358-1-raymondhackley@protonmail.com> References: <20240406111348.14358-1-raymondhackley@protonmail.com> Feedback-ID: 49437091:user:proton Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Core Prime LTE uses ST LIS2HH12 accelerometer. Add support for it. [Stephen: Use common &st_accel definition from common dtsi] Signed-off-by: Stephan Gerhold Signed-off-by: Raymond Hackley --- .../arm64/boot/dts/qcom/msm8916-samsung-rossa-common.dtsi | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-rossa-common.dtsi b/arch/arm64/boot/dts/qcom/msm8916-samsung-rossa-common.dtsi index b438fa81886c..db95bdbb9f32 100644 --- a/arch/arm64/boot/dts/qcom/msm8916-samsung-rossa-common.dtsi +++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-rossa-common.dtsi @@ -26,3 +26,11 @@ &clk_pwm { &clk_pwm_backlight { status = "disabled"; }; + +&st_accel { + compatible = "st,lis2hh12"; + mount-matrix = "1", "0", "0", + "0", "-1", "0", + "0", "0", "1"; + status = "okay"; +};