From patchwork Fri Apr 5 12:08:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raymond Hackley X-Patchwork-Id: 13618976 Received: from mail-40140.protonmail.ch (mail-40140.protonmail.ch [185.70.40.140]) (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 913B916C458; Fri, 5 Apr 2024 12:09:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.70.40.140 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712318951; cv=none; b=PNE8tQh+QPmKlJEu/yzpi0MNnJtwJgfA2s/uZ/R826vOzmrihiwF7/sv4MG0obi/584v5yEmM4oIOMksIlWjUf+ffEHHtvjgNF1O1g98xfVfPocPbqeRf3+a/1/jr/6jGG9cudVlOMjBYhbLXpuZ/uKVkXztWau5ukfKKGenET8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712318951; c=relaxed/simple; bh=pJc4/jf0PFlwsIdcAIRexnTe64XtHIYH2HV2IEn40jQ=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=LBQgQyqu4FDFsLY3FhYcZ1S4RbI+R517B+CjdJ2IXAN+74LUBm2nHN921GiymI4EFCgpdwQAVhDsmRerU3Bu2C7CKotf8hqEz+ltNX5Lc6RO8Zx9jAyivQzFNzXVEMu2FovxBRqpx+X4HUBydoXJt2TJpc0NUfV3cJFeZ+G3RvA= 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=ff7jRve3; arc=none smtp.client-ip=185.70.40.140 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="ff7jRve3" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1712318941; x=1712578141; bh=m7pYILs7yFgTClwOKJdvPDTNK5p8LzvChuFPPm/5hkE=; 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=ff7jRve3OKzseIbe5MnxW4Iijl5KA1glKA13DdrSVPAWke5/V3eYqUXcSz/wOyHOm vZFg4vXi0mtpVlScvpEaV91X61EZOt0owzxq463aCfFXqSOlJdwag8uU/vQC8/UGge CcaelWWaIpl0wF0zUouP3zkoPkT6on1vSzOoRxPvSSiIiABRrjulNMA/T8K1ofdp2u CET2A9y6qhwP024BWa9653csmxGp2IpeLCsRmI6Pq+CfTkK6Du1m38d0mkw70creWX 2dF/mYOS5O6+OyDdaw4sqldzL/haqSb64IvipGhznJD51Lc9//GlIL4QQhRUD99yrN WNHpmIkIcozoA== Date: Fri, 05 Apr 2024 12:08:55 +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 , Raymond Hackley Subject: [PATCH 2/3] arm64: dts: qcom: msm8916-samsung-fortuna: Add LSM303C accelerometer/magnetometer Message-ID: <20240405120803.20754-3-raymondhackley@protonmail.com> In-Reply-To: <20240405120803.20754-1-raymondhackley@protonmail.com> References: <20240405120803.20754-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 | 34 +++++++++++++++++++ 2 files changed, 42 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..1c3e3b860d44 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,40 @@ bosch_magn: magnetometer@12 { status = "disabled"; }; + + st_accel: accelerometer@1d { + compatible = "st,lsm303c-accel"; + reg = <0x1d>; + interrupts-extended = <&tlmm 115 IRQ_TYPE_LEVEL_HIGH>; + interrupt-names = "INT1"; + + 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 {