From patchwork Mon Jun 22 15:17:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephan Gerhold X-Patchwork-Id: 194622 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 58B70C433E5 for ; Mon, 22 Jun 2020 15:18:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 38A2220732 for ; Mon, 22 Jun 2020 15:18:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gerhold.net header.i=@gerhold.net header.b="fNei1RLr" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729153AbgFVPSn (ORCPT ); Mon, 22 Jun 2020 11:18:43 -0400 Received: from mo4-p02-ob.smtp.rzone.de ([81.169.146.170]:32356 "EHLO mo4-p02-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729460AbgFVPSl (ORCPT ); Mon, 22 Jun 2020 11:18:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1592839116; s=strato-dkim-0002; d=gerhold.net; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: X-RZG-CLASS-ID:X-RZG-AUTH:From:Subject:Sender; bh=02CvZjRE98epBK/EDiy35y49lXVrv+PD15JvvHTDs8M=; b=fNei1RLrKpz0egZxf7wirJvtqfOqCRvKwF6t7BDIFNPvTU3hpP15NbU0km6eSjJzH6 Zp8qFNprN/OoFN96GP+J/3AcWGUzhk8+NBuYEsDsk0jiYdb26LMZh4vrc+w6DX/dtmZV tYZ8j1pH4O4TBo5bTy6RCWl8x99GYWcx/rg13Bb4bK/7MS1RxzqTgi/UGdMLIEO4135M 92j/Q9iHpSmfj+5p3dKyTbA0h0jJc0SYPEZymJPEjtrsds1JZ3v1FOo+SWuPLjWskb77 c4DsZfgjYOYIV6S5b1bgzTG1F5Rfb3dekF2rT3XP5ik9DReur6k14y0n3uURJVgl438c 7HsA== X-RZG-AUTH: ":P3gBZUipdd93FF5ZZvYFPugejmSTVR2nRPhVORvLd4SsytBXS7IYBkLahKxB4G6OIUPH" X-RZG-CLASS-ID: mo00 Received: from localhost.localdomain by smtp.strato.de (RZmta 46.10.4 DYNA|AUTH) with ESMTPSA id 6005e9w5MFIY5Xw (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Mon, 22 Jun 2020 17:18:34 +0200 (CEST) From: Stephan Gerhold To: Andy Gross , Bjorn Andersson Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, Srinivas Kandagatla , ~postmarketos/upstreaming@lists.sr.ht, Stephan Gerhold Subject: [PATCH 3/4] arm64: dts: qcom: msm8916: Use higher I2C drive-strength only on DB410c Date: Mon, 22 Jun 2020 17:17:50 +0200 Message-Id: <20200622151751.408995-4-stephan@gerhold.net> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200622151751.408995-1-stephan@gerhold.net> References: <20200622151751.408995-1-stephan@gerhold.net> MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Commit c240f29e75e6 ("arm64: dts: set the default i2c pin drive strength to 16mA") changed the default drive-strength for I2C pins in msm8916-pins.dtsi to the maximum possible (16 mA). While this makes sense for apq8016-sbc (DB410c) where you can connect an arbitrary amount of I2C devices with level shifters etc, there is no need to use a higher drive strength for other MSM8916 devices. The minimum drive strength (2 mA) seems to be totally sufficient to have everything work there. With the short pinctrl nodes introduced earlier we can easily override the drive-strength only for apq8016-sbc now. Use that and change the default back to 2 mA. i2c1_default/i2c5_default are already using 2 mA because they were added separately later and are not used in apq8016-sbc. Cc: Srinivas Kandagatla Signed-off-by: Stephan Gerhold --- arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi | 16 ++++++++++++++++ arch/arm64/boot/dts/qcom/msm8916-pins.dtsi | 6 +++--- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi b/arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi index 6fff96a158e9..194343510dcb 100644 --- a/arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi +++ b/arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi @@ -779,6 +779,22 @@ l18 { }; }; +/* + * 2mA drive strength is not enough when connecting multiple + * I2C devices with different pull up resistors. + */ +&i2c2_default { + drive-strength = <16>; +}; + +&i2c4_default { + drive-strength = <16>; +}; + +&i2c6_default { + drive-strength = <16>; +}; + &msmgpio { msmgpio_leds: msmgpio-leds { pins = "gpio21", "gpio120"; diff --git a/arch/arm64/boot/dts/qcom/msm8916-pins.dtsi b/arch/arm64/boot/dts/qcom/msm8916-pins.dtsi index e1d4f8df7e79..4dc437f13fa5 100644 --- a/arch/arm64/boot/dts/qcom/msm8916-pins.dtsi +++ b/arch/arm64/boot/dts/qcom/msm8916-pins.dtsi @@ -208,7 +208,7 @@ i2c2_default: i2c2-default { pins = "gpio6", "gpio7"; function = "blsp_i2c2"; - drive-strength = <16>; + drive-strength = <2>; bias-disable; }; @@ -224,7 +224,7 @@ i2c4_default: i2c4-default { pins = "gpio14", "gpio15"; function = "blsp_i2c4"; - drive-strength = <16>; + drive-strength = <2>; bias-disable; }; @@ -256,7 +256,7 @@ i2c6_default: i2c6-default { pins = "gpio22", "gpio23"; function = "blsp_i2c6"; - drive-strength = <16>; + drive-strength = <2>; bias-disable; }; From patchwork Mon Jun 22 15:17:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephan Gerhold X-Patchwork-Id: 194623 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E96B3C433E4 for ; Mon, 22 Jun 2020 15:18:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C8CD22074D for ; Mon, 22 Jun 2020 15:18:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gerhold.net header.i=@gerhold.net header.b="dLDFsdNE" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729497AbgFVPSn (ORCPT ); Mon, 22 Jun 2020 11:18:43 -0400 Received: from mo4-p02-ob.smtp.rzone.de ([85.215.255.84]:21953 "EHLO mo4-p02-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729462AbgFVPSm (ORCPT ); Mon, 22 Jun 2020 11:18:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1592839117; s=strato-dkim-0002; d=gerhold.net; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: X-RZG-CLASS-ID:X-RZG-AUTH:From:Subject:Sender; bh=eUybk80IehW1UzAjbTnyoIiCZjoRefk+5Fnl2dnnB/0=; b=dLDFsdNE26KSiHN4HyWxKF8TX+r6x0UzNaDmXBM+UdVL0a+hv+sOBpwkBr6p3s5e8G bq6Kl0uodSfZw0xSbY9tFuuozunnHS5nxcj/UlfFaXhShz+JEJo/FwuzUC6oOxZ7gfSE +6NPfFq+nXUNEQtjc0K2ERpErmV1l26U5OP7CEqT4YhvVKV6z3xbmqQmkgzdgBgQ7g4a Hx2hjpjJC3YOCr3FWPbBBodboQIsuiZsSstc+h3kXjCWqmck2r4rdkWl0dBteFOnA1VB 0J/KO/vS2N1qcw/9eNzcPuK9Ul6rVyosJRIbMMpQ67O3Rx6ZALyXVmV09GB8MobiJQVP LSrQ== X-RZG-AUTH: ":P3gBZUipdd93FF5ZZvYFPugejmSTVR2nRPhVORvLd4SsytBXS7IYBkLahKxB4G6OIUPH" X-RZG-CLASS-ID: mo00 Received: from localhost.localdomain by smtp.strato.de (RZmta 46.10.4 DYNA|AUTH) with ESMTPSA id 6005e9w5MFIY5Xz (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Mon, 22 Jun 2020 17:18:34 +0200 (CEST) From: Stephan Gerhold To: Andy Gross , Bjorn Andersson Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, Srinivas Kandagatla , ~postmarketos/upstreaming@lists.sr.ht, Stephan Gerhold , Michael Srba Subject: [PATCH 4/4] arm64: dts: qcom: msm8916-samsung-a2015: Add accelerometer/magnetometer Date: Mon, 22 Jun 2020 17:17:51 +0200 Message-Id: <20200622151751.408995-5-stephan@gerhold.net> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200622151751.408995-1-stephan@gerhold.net> References: <20200622151751.408995-1-stephan@gerhold.net> MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org A3U/A5U both 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. The only difference between A3U/A5U is the way the sensor is mounted on the mainboard - set the mount-matrix in the device-specific device tree part to handle that difference. Co-developed-by: Michael Srba Signed-off-by: Michael Srba Signed-off-by: Stephan Gerhold --- .../qcom/msm8916-samsung-a2015-common.dtsi | 27 +++++++++++++++++++ .../boot/dts/qcom/msm8916-samsung-a3u-eur.dts | 6 +++++ .../boot/dts/qcom/msm8916-samsung-a5u-eur.dts | 6 +++++ 3 files changed, 39 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-a2015-common.dtsi b/arch/arm64/boot/dts/qcom/msm8916-samsung-a2015-common.dtsi index 58485d055241..a0c00d9d62c4 100644 --- a/arch/arm64/boot/dts/qcom/msm8916-samsung-a2015-common.dtsi +++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-a2015-common.dtsi @@ -167,6 +167,25 @@ muic: sm5502@25 { }; }; +&blsp_i2c2 { + status = "okay"; + + accelerometer: accelerometer@10 { + compatible = "bosch,bmc150_accel"; + reg = <0x10>; + interrupt-parent = <&msmgpio>; + interrupts = <115 IRQ_TYPE_EDGE_RISING>; + + pinctrl-names = "default"; + pinctrl-0 = <&accel_int_default>; + }; + + magnetometer@12 { + compatible = "bosch,bmc150_magn"; + reg = <0x12>; + }; +}; + &spmi_bus { pm8916@0 { pon@800 { @@ -294,6 +313,14 @@ l18 { }; &msmgpio { + accel_int_default: accel-int-default { + pins = "gpio115"; + function = "gpio"; + + drive-strength = <2>; + bias-disable; + }; + gpio_keys_default: gpio-keys-default { pins = "gpio107", "gpio109"; function = "gpio"; diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-a3u-eur.dts b/arch/arm64/boot/dts/qcom/msm8916-samsung-a3u-eur.dts index 33160a3687ce..410c7d199f96 100644 --- a/arch/arm64/boot/dts/qcom/msm8916-samsung-a3u-eur.dts +++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-a3u-eur.dts @@ -22,6 +22,12 @@ reg_panel_vdd3: regulator-panel-vdd3 { }; }; +&accelerometer { + mount-matrix = "0", "1", "0", + "1", "0", "0", + "0", "0", "1"; +}; + &dsi0 { panel@0 { reg = <0>; diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-a5u-eur.dts b/arch/arm64/boot/dts/qcom/msm8916-samsung-a5u-eur.dts index e4b6fa18ca25..e39c04d977c2 100644 --- a/arch/arm64/boot/dts/qcom/msm8916-samsung-a5u-eur.dts +++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-a5u-eur.dts @@ -9,6 +9,12 @@ / { compatible = "samsung,a5u-eur", "qcom,msm8916"; }; +&accelerometer { + mount-matrix = "-1", "0", "0", + "0", "1", "0", + "0", "0", "1"; +}; + &blsp_i2c5 { status = "okay";