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: 205491 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.9 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, 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 0BCC3C32771 for ; Wed, 22 Jan 2020 08:02:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D44EE2467A for ; Wed, 22 Jan 2020 08:02:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="EfO9tSj7" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729143AbgAVICR (ORCPT ); Wed, 22 Jan 2020 03:02:17 -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: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@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: 205490 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.9 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, 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 85C78C33CB6 for ; Wed, 22 Jan 2020 08:02:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5D36B24655 for ; Wed, 22 Jan 2020 08:02:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="BjJ7Ofv0" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729095AbgAVICK (ORCPT ); Wed, 22 Jan 2020 03:02:10 -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: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@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 --- 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: