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>;