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 {