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: 11345135 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 88CC317EA for ; Wed, 22 Jan 2020 08:02:39 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6217E2467A for ; Wed, 22 Jan 2020 08:02:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="oPpBaqjf"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=ti.com header.i=@ti.com header.b="BjJ7Ofv0" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6217E2467A Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=ti.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=GIGmrwJfjGtFuxuqfOngwaFWw3hzrEbSyhd9nNtFwz4=; b=oPpBaqjfTlA/TF zD8t7/+Iff9EuXi5SDWe3EOfnGWtGa5mDPnAj3F7D81r0sZxV9+rPLuY7TY6s9RmU76uzSRhUHf77 ABHK93BoEoEQ188DkO5gcsD/4EhKDPgEyqb3K+WyXSvnV7xUFUOVqgox/CanPntY6B8PQVRt97jm/ xmkfwU9y/T33HuyVFJb1A7ZcJrVj7ZLvIGus+0KBUHdI1V4glnA6h3h/w8ZREQCRVLYy0BgqSynks o2Ibat3PHA1NBEMoFdknV6VYu8rF1INJv+0d62Boe+ZT71F1xHzVhL9vjPuMxfdOm8aMi/6aDBKXn MOA7x82riVi/ehLBB/jw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iuAyC-0006gP-6v; Wed, 22 Jan 2020 08:02:36 +0000 Received: from lelv0143.ext.ti.com ([198.47.23.248]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iuAxe-0006FG-3L for linux-arm-kernel@lists.infradead.org; Wed, 22 Jan 2020 08:02:03 +0000 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: , , , , 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200122_000202_217609_C7D2B5BA X-CRM114-Status: GOOD ( 13.60 ) X-Spam-Score: -2.5 (--) X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: Content analysis details: (-2.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [198.47.23.248 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.0 DKIMWL_WL_HIGH DKIMwl.org - Whitelisted High sender X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.rutland@arm.com, nm@ti.com, catalin.marinas@arm.com, sriram.dash@samsung.com, faiz_abbas@ti.com, t-kristo@ti.com, robh+dt@kernel.org, mkl@pengutronix.de, dmurphy@ti.com, davem@davemloft.net, wg@grandegger.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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: