Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4564438ybl; Wed, 22 Jan 2020 00:03:17 -0800 (PST) X-Google-Smtp-Source: APXvYqzY+JqSUrjIej1ukwOSpVRcd6wBAXRxtzCGYdOoI7tsnPJ0JVaPHOfoWEy1xvbFirjEfXBJ X-Received: by 2002:a9d:4711:: with SMTP id a17mr570772otf.233.1579680196948; Wed, 22 Jan 2020 00:03:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579680196; cv=none; d=google.com; s=arc-20160816; b=n5zJ4KoXhnCZlNU08KDkHK4A6eX8+bR1mKIIPCIOH+RXn7307iSmg7uXLoLmPA+Ao5 Y748eBFa7TjybMQr6EILPtj79Atlp10a7a/zT3J+fu36H7u2UxcaVwsgc5pgruZvg7Aa 97HGV/qaDIGugn1VpOL92jGg/NTWVpj7EU8dwvYXU/kPh203bz/s1teopTUAxp5b60Ti 3OU9hvgjFilnX7e+5jBwS7oIxdK5A5pabWQCDYl9nn54/CEuO4vYs5Mq2KSChRgCfj6h LrC1WFbcnLr/ekKBx/0CrEflGZtplqSKzDQjktzCdUqXHNrb6UsIM1tRQ1ohQzKybv8J 7wWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=7UOBwHxmUYxfqiqO99WZtNYVwWL8yFEFOypvW6QAPs4=; b=ebdjveRFEtbzJZos5ySrbpEQDXHRm0MduHCYiy/9DLrAQHPmi3i1s4Wvurojk/JPL7 aq71qnWYSSYo2G8FPcj6nao5t9jXVqCoe8wZVScKnZkmKljdtznAFEozmK2HuiSaXeGF oC7oN7R3Jd5HGur+kjwRZkkik5UwZzkwaIBkW4eQiti7mp7Uo4JaxX0K1YRrqWs6U5BD a886zJkLhoBWLVvxyqiCL2+Ug+E86Axd+dTpMHJ72HqAC7oyq/3dJlrtPqORY1Yw5okh 3kZhtO0YiGPKJqC43MP7Qwffx+ZsMOGe92wX4dUyKwn35mkoocmQUjmc1eVqyy7OSX5n uyyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=BjJ7Ofv0; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y126si21063243oiy.235.2020.01.22.00.03.05; Wed, 22 Jan 2020 00:03:16 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=BjJ7Ofv0; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729129AbgAVICM (ORCPT + 99 others); Wed, 22 Jan 2020 03:02:12 -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 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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: -- 2.19.2