From patchwork Wed Jan 22 08:03:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Faiz Abbas X-Patchwork-Id: 1227047 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=ti.com header.i=@ti.com header.a=rsa-sha256 header.s=ti-com-17Q1 header.b=EfO9tSj7; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 482dDH2nQJz9sP6 for ; Wed, 22 Jan 2020 19:02:23 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729180AbgAVICS (ORCPT ); Wed, 22 Jan 2020 03:02:18 -0500 Received: from lelv0142.ext.ti.com ([198.47.23.249]:33134 "EHLO lelv0142.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729085AbgAVICL (ORCPT ); Wed, 22 Jan 2020 03:02:11 -0500 Received: from lelv0265.itg.ti.com ([10.180.67.224]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 00M81nxc100955; Wed, 22 Jan 2020 02:01:49 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1579680109; bh=QEfHc54Sq3cSMEDsHEl0ZkK03ez70ajlWEziFOuth0s=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=EfO9tSj7GDP5hTZLOndOZttkXugBuJEfedDzVvAjwzrES7ihJTzt5lRUOMljZm2+M sVHnYei65s+/1YJfdH7U7Ah0wBLjrljQMFFrdnOvPSd5V8qq0oMnB25jiFOvkNvVIJ lsh5Zvvs5EqbF95d5rGbfWpVgGYcD2kCtj5AJGyc= Received: from DFLE114.ent.ti.com (dfle114.ent.ti.com [10.64.6.35]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 00M81ng8079140 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 22 Jan 2020 02:01:49 -0600 Received: from DFLE102.ent.ti.com (10.64.6.23) by DFLE114.ent.ti.com (10.64.6.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3; Wed, 22 Jan 2020 02:01:49 -0600 Received: from lelv0326.itg.ti.com (10.180.67.84) by DFLE102.ent.ti.com (10.64.6.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3 via Frontend Transport; Wed, 22 Jan 2020 02:01:49 -0600 Received: from a0230074-OptiPlex-7010.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id 00M81ctn007984; Wed, 22 Jan 2020 02:01:44 -0600 From: Faiz Abbas To: , , , , CC: , , , , , , , , , , Subject: [PATCH 1/3] dt-bindings: net: can: m_can: Add Documentation for stb-gpios Date: Wed, 22 Jan 2020 13:33:08 +0530 Message-ID: <20200122080310.24653-2-faiz_abbas@ti.com> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20200122080310.24653-1-faiz_abbas@ti.com> References: <20200122080310.24653-1-faiz_abbas@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The CAN transceiver on some boards has an STB pin which is used to control its standby mode. Add an optional property stb-gpios to toggle the same. Signed-off-by: Faiz Abbas Signed-off-by: Sekhar Nori --- Documentation/devicetree/bindings/net/can/m_can.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/net/can/m_can.txt b/Documentation/devicetree/bindings/net/can/m_can.txt index ed614383af9c..cc8ba3f7a2aa 100644 --- a/Documentation/devicetree/bindings/net/can/m_can.txt +++ b/Documentation/devicetree/bindings/net/can/m_can.txt @@ -48,6 +48,8 @@ Optional Subnode: that can be used for CAN/CAN-FD modes. See Documentation/devicetree/bindings/net/can/can-transceiver.txt for details. +stb-gpios : gpio node to toggle the STB (standby) signal on the transceiver + Example: SoC dtsi: m_can1: can@20e8000 { From patchwork Wed Jan 22 08:03:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Faiz Abbas X-Patchwork-Id: 1227046 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=ti.com header.i=@ti.com header.a=rsa-sha256 header.s=ti-com-17Q1 header.b=BjJ7Ofv0; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 482dD873Gwz9sP6 for ; Wed, 22 Jan 2020 19:02:16 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729121AbgAVICL (ORCPT ); Wed, 22 Jan 2020 03:02:11 -0500 Received: from lelv0143.ext.ti.com ([198.47.23.248]:44008 "EHLO lelv0143.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726077AbgAVICK (ORCPT ); Wed, 22 Jan 2020 03:02:10 -0500 Received: from lelv0265.itg.ti.com ([10.180.67.224]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id 00M81sgo059119; Wed, 22 Jan 2020 02:01:54 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1579680114; bh=7UOBwHxmUYxfqiqO99WZtNYVwWL8yFEFOypvW6QAPs4=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=BjJ7Ofv09fQIGGvSb3Z2YQmpzCzQSSXuAXMGB6Cft+lyKzTwTP3bD5V+Rn/6k3LXJ 8b1nUjbeWD8h2Of6LzRrI0rIf23K/32ImENz52Bu8vkFP/CNhTQiJfSWA1em9v4Ir1 pzn1Jq+yh+bigpWCs0xjPo1ZWB88z/YsEDb9MOEk= Received: from DLEE113.ent.ti.com (dlee113.ent.ti.com [157.170.170.24]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 00M81s8C079187 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 22 Jan 2020 02:01:54 -0600 Received: from DLEE102.ent.ti.com (157.170.170.32) by DLEE113.ent.ti.com (157.170.170.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3; Wed, 22 Jan 2020 02:01:53 -0600 Received: from lelv0326.itg.ti.com (10.180.67.84) by DLEE102.ent.ti.com (157.170.170.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3 via Frontend Transport; Wed, 22 Jan 2020 02:01:53 -0600 Received: from a0230074-OptiPlex-7010.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id 00M81cto007984; Wed, 22 Jan 2020 02:01:49 -0600 From: Faiz Abbas To: , , , , CC: , , , , , , , , , , Subject: [PATCH 2/3] can: m_can: m_can_platform: Add support for enabling transceiver through the STB line Date: Wed, 22 Jan 2020 13:33:09 +0530 Message-ID: <20200122080310.24653-3-faiz_abbas@ti.com> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20200122080310.24653-1-faiz_abbas@ti.com> References: <20200122080310.24653-1-faiz_abbas@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org CAN transceivers on some boards have an STB (standby) line which can be toggled to enable/disable the transceiver. Add support for enabling the transceiver using a GPIO connected to the STB line. Signed-off-by: Faiz Abbas Acked-by: Sriram Dash --- drivers/net/can/m_can/m_can_platform.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/net/can/m_can/m_can_platform.c b/drivers/net/can/m_can/m_can_platform.c index 38ea5e600fb8..b4e1423bd5d8 100644 --- a/drivers/net/can/m_can/m_can_platform.c +++ b/drivers/net/can/m_can/m_can_platform.c @@ -6,6 +6,7 @@ // Copyright (C) 2018-19 Texas Instruments Incorporated - http://www.ti.com/ #include +#include #include "m_can.h" @@ -57,6 +58,7 @@ static int m_can_plat_probe(struct platform_device *pdev) { struct m_can_classdev *mcan_class; struct m_can_plat_priv *priv; + struct gpio_desc *stb; struct resource *res; void __iomem *addr; void __iomem *mram_addr; @@ -111,6 +113,16 @@ static int m_can_plat_probe(struct platform_device *pdev) m_can_init_ram(mcan_class); + stb = devm_gpiod_get_optional(&pdev->dev, "stb", GPIOD_OUT_HIGH); + if (IS_ERR(stb)) { + ret = PTR_ERR(stb); + if (ret != -EPROBE_DEFER) + dev_err(&pdev->dev, + "gpio request failed, ret %d\n", ret); + + goto failed_ret; + } + ret = m_can_class_register(mcan_class); failed_ret: From patchwork Wed Jan 22 08:03:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Faiz Abbas X-Patchwork-Id: 1227048 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=ti.com header.i=@ti.com header.a=rsa-sha256 header.s=ti-com-17Q1 header.b=H8JS9PL6; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 482dDL298vz9sP6 for ; Wed, 22 Jan 2020 19:02:26 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729149AbgAVICR (ORCPT ); Wed, 22 Jan 2020 03:02:17 -0500 Received: from fllv0016.ext.ti.com ([198.47.19.142]:39232 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726077AbgAVICP (ORCPT ); Wed, 22 Jan 2020 03:02:15 -0500 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 00M8216g096402; Wed, 22 Jan 2020 02:02:01 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1579680121; bh=L5WORfa0XWhVNa/Scr/I2SAMSorVTSS3dl2PznqchpI=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=H8JS9PL6gMPY+fTx+VqgqFwqovJSeQX5q0Pmqy9hU7Y6bbOm5S3g8aljL9yyaLG4s M76aqGADTnD/DhmUIIbqWH8T+3HiuvbokXjGzkT8mCiA1vV6+u6g/UoNmi6XBGACeU AI9pNZRF9TGPkGS/g4U6eMb9vhStCE0mQwfFvpRE= Received: from DLEE105.ent.ti.com (dlee105.ent.ti.com [157.170.170.35]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 00M821Ro096714 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 22 Jan 2020 02:02:01 -0600 Received: from DLEE115.ent.ti.com (157.170.170.26) by DLEE105.ent.ti.com (157.170.170.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3; Wed, 22 Jan 2020 02:01:58 -0600 Received: from lelv0326.itg.ti.com (10.180.67.84) by DLEE115.ent.ti.com (157.170.170.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3 via Frontend Transport; Wed, 22 Jan 2020 02:01:58 -0600 Received: from a0230074-OptiPlex-7010.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id 00M81ctp007984; Wed, 22 Jan 2020 02:01:54 -0600 From: Faiz Abbas To: , , , , CC: , , , , , , , , , , Subject: [PATCH 3/3] arm64: defconfig: Add Support for Bosch M_CAN controllers Date: Wed, 22 Jan 2020 13:33:10 +0530 Message-ID: <20200122080310.24653-4-faiz_abbas@ti.com> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20200122080310.24653-1-faiz_abbas@ti.com> References: <20200122080310.24653-1-faiz_abbas@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Enable configs for supporting Bosch M_CAN controllers. Signed-off-by: Faiz Abbas --- arch/arm64/configs/defconfig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig index 458bddeba89c..9d2ea46cc4ae 100644 --- a/arch/arm64/configs/defconfig +++ b/arch/arm64/configs/defconfig @@ -159,6 +159,9 @@ CONFIG_QRTR=m CONFIG_QRTR_SMD=m CONFIG_QRTR_TUN=m CONFIG_BPF_JIT=y +CONFIG_CAN=m +CONFIG_CAN_M_CAN=m +CONFIG_CAN_M_CAN_PLATFORM=m CONFIG_BT=m CONFIG_BT_HIDP=m # CONFIG_BT_HS is not set