From patchwork Fri Apr 5 12:08:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raymond Hackley X-Patchwork-Id: 13618975 Received: from mail-0201.mail-europe.com (mail-0201.mail-europe.com [51.77.79.158]) (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 7FE6E16C842; Fri, 5 Apr 2024 12:08:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=51.77.79.158 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712318933; cv=none; b=eCn+vWaxxa9s+vsdriFtFc4XUvm8NViq/S6UOiOON2OOnPTdRZ7WNJ5Awx7R9LQoOuyqHm7ce777ViSkIfTeIDfaZSBMmohD9Tfmc4u2dhXH3LGx8+H8dweWtx2pwngltSkBKEKBZB/8Ujmu68SZPC7DSJoFpnNAKEr67NNSQ9g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712318933; c=relaxed/simple; bh=a47454EdCwraOlJHbDpA8w0pS4WuEE+DQis9OxZ5xXg=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=HT1W1EWoKgYj4G63vetBnVeJEDLDyHKUdFMVG/NMlyyD1/n6hmDLUv6ai93OKE0EU58mswAz9HNpHEBif5XZKHNanu+mEIq5iwvwLQ7uKAvkE+4o7J35vqmUJ4BF8tBn2X6f83fVgluGl8wL+uSF6kXQDs3NlR8SRay5QENSULU= 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=We98t24d; arc=none smtp.client-ip=51.77.79.158 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="We98t24d" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1712318919; x=1712578119; 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=We98t24dS2Po1jPmx5qHu0E+UfQuwBn6M8iGyckVjrCTBSkomf71Ae8z6cx6XR+Iq ASfGYuHP7i30456fQvH8ij8D5OK5lf2skh9IKf6DKwLTVOalb5qZoUD0KFM35Ot1CN uVYENvP+rqceu3Jup1ujgVoq00/DIXSS1J34TSKsxBPYzAMWk0DDqfEsep1ILrFbP8 vechrwBru0ya6lJ+7WRJZIIeIJ4d8BQmb0NdwnDOQ1yXt1SXpwR+A1zR3og0DqgI3k 1XEMlfLssw4m6g1kKWN7WaLsjQ0x618szXWFROhgtNDsiPg9vwhNKyu09rH1/2OXUL VkCJC37sH+X+A== Date: Fri, 05 Apr 2024 12:08:35 +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 , Raymond Hackley Subject: [PATCH 1/3] arm64: dts: qcom: msm8916-samsung-fortuna: Add BMC150 accelerometer/magnetometer Message-ID: <20240405120803.20754-2-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: 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 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 { From patchwork Fri Apr 5 12:09:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raymond Hackley X-Patchwork-Id: 13618977 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 7346A16C6B7 for ; Fri, 5 Apr 2024 12:09:26 +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=1712318967; cv=none; b=Hbe9o8j+6HbCH1U1iFac4YdDG22j1E4VKMp2EAGFIFzeHjM57jEhkkKOWC8jFKTXWxjaDPTSw6ieb2Nxuc9mwMuYnonJG2Tq6Kre5uJUrkD4+IUqCf30cIMvfZhR71C/1s35tdpXZeIBr9sF9WoD+LfUelAeGwqLfaxhDwT5/00= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712318967; 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=n26IK/NWBxhbZWyPEqBDSHhgazzK9EyCVwEWd4zE4Gryau0Jyo77qF9ADbjZgCZW/Th5wa+hDfEtijx9700/N+dArHfuGNis4MwORZOtVoD41vkp8m/Wa6R/kk4mX0IB+V2hPUrLdKuZt0znduAagzZdcb+lfKNkLe42tXBxvEs= 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=DC854iDn; 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="DC854iDn" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1712318964; x=1712578164; 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=DC854iDnh1UXxMT0aTx7XFE+luousZF1j8Yexsb3qfOT4QH3aQcoSrhltPANVv6Ya fy9gCo+6uvmwRw9R7X9J5nfSE7j7HGWZZnERCvugvna1KKnFZUoKEVv18s6w+AlszO ziKN/p81sIv661MLyqGxJKRtwm1UcnmX5JubDgvNM+kgo0A+KJriWmNSwTPAeASTYf n6ORjSIiISZsWx4ZbGzzxQSDfJbA2vx0dtwqQHXz4OakD1fmOtZ2Od71NiVMTsbOz1 zAg9/O+WOXa1LKfz00PVl/efMlFAgX1Lb6CQZ8XgnVdSl+BLXFbR7Uy51uXf9/Ci9a K0ocUM+cxvaQQ== Date: Fri, 05 Apr 2024 12:09:14 +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, Raymond Hackley Subject: [PATCH 3/3] arm64: dts: qcom: msm8916-samsung-rossa: Add LIS2HH12 accelerometer Message-ID: <20240405120803.20754-4-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 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"; +};