From mboxrd@z Thu Jan 1 00:00:00 1970 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=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,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 270B9C5DF60 for ; Thu, 7 Nov 2019 20:19:26 +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 E68452166E for ; Thu, 7 Nov 2019 20:19:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="F9yUX/Dm"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="fChiVLhY" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E68452166E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.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=e4yORBI1wY1Ys3VhX3L4bgKDDP3qvmmIzJB1RwQWmn0=; b=F9yUX/DmbOEKsw SNRk26FhTIRmqOXH2Dbabgdgza/suRxaqgiBDXElARIhZG/eG37wLL+gbB1lc5LMb+gYOT4+PBnM2 z3PWZEQrwwKUivyI+sA0DDbRwTBuy+RXkf+gKPRUbnZswX9L+SGbqbrwqcV7SpB8Zh/6U7P0TDfMW z3e8yVApd+zgu/3lQBshjuNG2kr0B70B9/c8ncJwdmtKka/SJA/9CVaQ4z+H0+OzPADZaSjk9074V WJTb/ye8MNvJyQNbaSnKMmshkEugpsIBnZl8l7xmvF2K/YunovhX8Gq5aXHVCCMem4JqPq3NSoOXL m/7CO5A8Tzfvo96F9Q+Q==; 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 1iSoFX-0008Mi-88; Thu, 07 Nov 2019 20:19:23 +0000 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iSoDU-0006Fp-KN for linux-arm-kernel@lists.infradead.org; Thu, 07 Nov 2019 20:17:18 +0000 Received: by mail-wr1-x444.google.com with SMTP id t1so4572668wrv.4 for ; Thu, 07 Nov 2019 12:17:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=IfBF8N8O1vGmVN86XMswrU/+wD8KeNGcTXaMDHv5bNc=; b=fChiVLhYdW8MmlavzflarIALwM6oQ0oST9a0xpt5JGB0qZEOMP7X0WdzhndbJXFXKD 6k8LOvZvA/TsBMcho59C3LYvbxjYxz0B/Cy2BlH6plJHiYRj6Q8UZdvSDthBoHwHKpiN lYU4B1emlpo79KIN0NkyazFGkzrtsvMP7v8jmv0bJiIGsicKBClB5c0w9mguUu2YQKrv IfcsibvoqBXkS96uVqk0slcwOz7Ht0tocUPpxc34eo5loD6TpalowitM3JU1+OYEsyIo fkw6xKIKLvF1OZmeSxx5MBOBO2rpemTZADULbrE++JP1JtBSnPL5q5NJuyJ8vihLnp/Y gkKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=IfBF8N8O1vGmVN86XMswrU/+wD8KeNGcTXaMDHv5bNc=; b=a5pd0CpSCUF/ERf7JfpRAzLLZgTt/fRqbpelfaKZVAgPAcxepVcm8rg8aURJYOLKUb SRg0/7/K5gx1/acX8WvxafYeyyxIt3ub1iseKTW24w2G41IccQUokVJR5QFKGo+XaqSt x5N2qznId2BqkwZLES6WX6tedS0Em3Vuj9jilraYNOfes3k4fSFQVNyRtvv336nDOZWK TZo3bAOuR3uXhTXMqUZSlOAytgGAEs6rYYelrpsP7n5dbhe4/tUMpUwTeYN4inI4/OYa 3sqtGVu8TCTUfugr25cOHdAWO9nsgM64O3vOAUhmRLsUZximV++OboQTHnijxOhJYyHD cGLA== X-Gm-Message-State: APjAAAX8lmLF/QmphNh37rYV1zPy0vsHkJpLxXM+0XFM04d/bIMeP30y wwmBvDy5NASACzn6irEB5KTf051uTfQ= X-Google-Smtp-Source: APXvYqxLeJVGJOzI2ZwJzDDqNvlQyCV/uNdN9GYB084GYIYZxX5OgQ/rW6PhFKY71ZiiT24Rhit05g== X-Received: by 2002:adf:b686:: with SMTP id j6mr4742254wre.186.1573157834960; Thu, 07 Nov 2019 12:17:14 -0800 (PST) Received: from localhost.localdomain ([95.147.198.88]) by smtp.gmail.com with ESMTPSA id d11sm3215162wrn.28.2019.11.07.12.17.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Nov 2019 12:17:14 -0800 (PST) From: Lee Jones To: gregkh@google.com Subject: [PATCH 10/10] can: mcp251x: add support for mcp25625 Date: Thu, 7 Nov 2019 20:17:02 +0000 Message-Id: <20191107201702.27023-10-lee.jones@linaro.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191107201702.27023-1-lee.jones@linaro.org> References: <20191107201702.27023-1-lee.jones@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191107_121716_739040_6EA89735 X-CRM114-Status: GOOD ( 15.29 ) 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: Sasha Levin , linux-kernel@vger.kernel.org, Marc Kleine-Budde , Sean Nyekjaer , Lee Jones , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Sean Nyekjaer [ Upstream commit 35b7fa4d07c43ad79b88e6462119e7140eae955c ] Fully compatible with mcp2515, the mcp25625 have integrated transceiver. This patch adds support for the mcp25625 to the existing mcp251x driver. Signed-off-by: Sean Nyekjaer Signed-off-by: Marc Kleine-Budde Signed-off-by: Sasha Levin Signed-off-by: Lee Jones Change-Id: I537254af4e09553f04873e3cf6be36dbbfc29c88 --- drivers/net/can/spi/Kconfig | 5 +++-- drivers/net/can/spi/mcp251x.c | 25 ++++++++++++++++--------- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/drivers/net/can/spi/Kconfig b/drivers/net/can/spi/Kconfig index 148cae5871a6..249d2db7d600 100644 --- a/drivers/net/can/spi/Kconfig +++ b/drivers/net/can/spi/Kconfig @@ -2,9 +2,10 @@ menu "CAN SPI interfaces" depends on SPI config CAN_MCP251X - tristate "Microchip MCP251x SPI CAN controllers" + tristate "Microchip MCP251x and MCP25625 SPI CAN controllers" depends on HAS_DMA ---help--- - Driver for the Microchip MCP251x SPI CAN controllers. + Driver for the Microchip MCP251x and MCP25625 SPI CAN + controllers. endmenu diff --git a/drivers/net/can/spi/mcp251x.c b/drivers/net/can/spi/mcp251x.c index c66d699640a9..6f86fdf6c9f1 100644 --- a/drivers/net/can/spi/mcp251x.c +++ b/drivers/net/can/spi/mcp251x.c @@ -1,5 +1,5 @@ /* - * CAN bus driver for Microchip 251x CAN Controller with SPI Interface + * CAN bus driver for Microchip 251x/25625 CAN Controller with SPI Interface * * MCP2510 support and bug fixes by Christian Pellegrin * @@ -41,7 +41,7 @@ * static struct spi_board_info spi_board_info[] = { * { * .modalias = "mcp2510", - * // or "mcp2515" depending on your controller + * // "mcp2515" or "mcp25625" depending on your controller * .platform_data = &mcp251x_info, * .irq = IRQ_EINT13, * .max_speed_hz = 2*1000*1000, @@ -237,6 +237,7 @@ static const struct can_bittiming_const mcp251x_bittiming_const = { enum mcp251x_model { CAN_MCP251X_MCP2510 = 0x2510, CAN_MCP251X_MCP2515 = 0x2515, + CAN_MCP251X_MCP25625 = 0x25625, }; struct mcp251x_priv { @@ -279,7 +280,6 @@ static inline int mcp251x_is_##_model(struct spi_device *spi) \ } MCP251X_IS(2510); -MCP251X_IS(2515); static void mcp251x_clean(struct net_device *net) { @@ -639,7 +639,7 @@ static int mcp251x_hw_reset(struct spi_device *spi) /* Wait for oscillator startup timer after reset */ mdelay(MCP251X_OST_DELAY_MS); - + reg = mcp251x_read_reg(spi, CANSTAT); if ((reg & CANCTRL_REQOP_MASK) != CANCTRL_REQOP_CONF) return -ENODEV; @@ -820,9 +820,8 @@ static irqreturn_t mcp251x_can_ist(int irq, void *dev_id) /* receive buffer 0 */ if (intf & CANINTF_RX0IF) { mcp251x_hw_rx(spi, 0); - /* - * Free one buffer ASAP - * (The MCP2515 does this automatically.) + /* Free one buffer ASAP + * (The MCP2515/25625 does this automatically.) */ if (mcp251x_is_2510(spi)) mcp251x_write_bits(spi, CANINTF, CANINTF_RX0IF, 0x00); @@ -831,7 +830,7 @@ static irqreturn_t mcp251x_can_ist(int irq, void *dev_id) /* receive buffer 1 */ if (intf & CANINTF_RX1IF) { mcp251x_hw_rx(spi, 1); - /* the MCP2515 does this automatically */ + /* The MCP2515/25625 does this automatically. */ if (mcp251x_is_2510(spi)) clear_intf |= CANINTF_RX1IF; } @@ -1004,6 +1003,10 @@ static const struct of_device_id mcp251x_of_match[] = { .compatible = "microchip,mcp2515", .data = (void *)CAN_MCP251X_MCP2515, }, + { + .compatible = "microchip,mcp25625", + .data = (void *)CAN_MCP251X_MCP25625, + }, { } }; MODULE_DEVICE_TABLE(of, mcp251x_of_match); @@ -1017,6 +1020,10 @@ static const struct spi_device_id mcp251x_id_table[] = { .name = "mcp2515", .driver_data = (kernel_ulong_t)CAN_MCP251X_MCP2515, }, + { + .name = "mcp25625", + .driver_data = (kernel_ulong_t)CAN_MCP251X_MCP25625, + }, { } }; MODULE_DEVICE_TABLE(spi, mcp251x_id_table); @@ -1254,5 +1261,5 @@ module_spi_driver(mcp251x_can_driver); MODULE_AUTHOR("Chris Elston , " "Christian Pellegrin "); -MODULE_DESCRIPTION("Microchip 251x CAN driver"); +MODULE_DESCRIPTION("Microchip 251x/25625 CAN driver"); MODULE_LICENSE("GPL v2"); -- 2.24.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel