From patchwork Fri Jan 11 17:32:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Murphy X-Patchwork-Id: 155353 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp834002jaa; Fri, 11 Jan 2019 09:33:07 -0800 (PST) X-Google-Smtp-Source: ALg8bN62FA6oOnyf0KE+Oe+hBMnhgOEYC9nMVW/dNf9k4+4Ofb2E+R8G/5oiItLhV7FlBD30LCGh X-Received: by 2002:a63:4819:: with SMTP id v25mr14018226pga.308.1547227987166; Fri, 11 Jan 2019 09:33:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547227987; cv=none; d=google.com; s=arc-20160816; b=YjqQDOS/ZhGAqdsWYOq6m+j6jdT0OZTUCc+MEVab3YkNgHQIpjQ0ObMYV3j7uDDhPO TTTU8SG/OCv/JW+FrNepRQrdj32Qfc2cT8wCKEYxscsfgE/FVdx0p3kgPEv15YDTMyUi tK7Qeooabst1WHAaBjCW5gQurYwg/x4JkMOrXuybTGCtFg81qs4XjuhFICWe+OmMHyAZ 5YYsFPoqgFC3VxWOfi/XDE3RKInYIFzsMaseqYkubjWPJFCqAQCibUEfg98xZGYsOctE MJSV8OjvuMR1g7VE9NL5aSOyU6VUKK886dutP3TcFyfqUKIx5jjIHrzEnRteXwOXV2t4 R8XA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=c+IiZbaHvpokgG+a9KsLRRzFAtSotSWXO48E0HPUsz4=; b=lzDQe72YWigWs10xCrpkHqdpwS7GCeUkZlp7HD59FfzLp8JI1CFSyXcUiPfHJh42e3 qUvDDmYrSweHSpFbuO37h1lUDo41QnbzF6NdGYpByP+5yBmyAasDsU8PuCd/IYPw7Ok8 51+6I7nkAtWtCCYJrJ9UpEuTwrDMJjWFbhE2g2tRaW9XPDe5FVzq1u0Op0DgFky8TE3X LVab0xQE0D7q7TQK45OjHFUGEMZ7/z0Kx5uK4xk17/lwyV/OPAUknIalrHdj/lzppV8E xkx5Cz84EVlodzGIK/TFD/Ikqjtz2a4XO2wPqThvzILcs99lLU6YDcoDfF7WAFa9tLHT xjWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=dfSy863R; 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 a10si69227094pgq.270.2019.01.11.09.33.06; Fri, 11 Jan 2019 09:33:07 -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=dfSy863R; 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 S2388479AbfAKRdF (ORCPT + 31 others); Fri, 11 Jan 2019 12:33:05 -0500 Received: from lelv0142.ext.ti.com ([198.47.23.249]:47012 "EHLO lelv0142.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387507AbfAKRdB (ORCPT ); Fri, 11 Jan 2019 12:33:01 -0500 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id x0BHWore096404; Fri, 11 Jan 2019 11:32:50 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1547227970; bh=c+IiZbaHvpokgG+a9KsLRRzFAtSotSWXO48E0HPUsz4=; h=From:To:CC:Subject:Date; b=dfSy863RR7nkFTuTm6AiyRRimW7YTwakrvBTEWlAPiCF7Uxwe/h/TuDEdScmOnd5U 6J5IDEzUWtm7NlerpvUSRcVbyqg7CKuyneqSiEbLezAI41qlPkcUO5gWTPDe4USoHd 7vNc/+5yL0VnCiNkmepgYZ0EeAX0dq+wg38bgFCQ= Received: from DLEE109.ent.ti.com (dlee109.ent.ti.com [157.170.170.41]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x0BHWoR6104300 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 11 Jan 2019 11:32:50 -0600 Received: from DLEE103.ent.ti.com (157.170.170.33) by DLEE109.ent.ti.com (157.170.170.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Fri, 11 Jan 2019 11:32:49 -0600 Received: from dlep33.itg.ti.com (157.170.170.75) by DLEE103.ent.ti.com (157.170.170.33) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1591.10 via Frontend Transport; Fri, 11 Jan 2019 11:32:49 -0600 Received: from legion.dal.desgin.ti.com (legion.dal.design.ti.com [128.247.22.53]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id x0BHWnB9015627; Fri, 11 Jan 2019 11:32:49 -0600 Received: from localhost (a0272616local-lt.dhcp.ti.com [172.22.88.224]) by legion.dal.desgin.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id x0BHWnU03632; Fri, 11 Jan 2019 11:32:49 -0600 (CST) From: Dan Murphy To: , , , CC: , , , Dan Murphy Subject: [PATCH v3 0/4] M_CAN Framework Date: Fri, 11 Jan 2019 11:32:32 -0600 Message-ID: <20190111173236.14329-1-dmurphy@ti.com> X-Mailer: git-send-email 2.12.2 MIME-Version: 1.0 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 All Well it has taken me a while to get this working and ported to a provide a m_can framework that manages the Bosch m_can stack and abstracts away devices to use that framework. The m_can.c is the framework that devices register to. The device abstractions can provide read/write capability as well as bit timings and also provide any other initializations that are device specific. The m_can platform code will need to be updated as I have not tested this code. The tcan code is working. Dan Dan Murphy (4): can: m_can: Create a m_can platform framework can: m_can: Migrate the m_can code to use the framework dt-bindings: can: tcan4x5x: Add DT bindings for TCAN4x5X driver can: tcan4x5x: Add tcan4x5x driver to the kernel .../devicetree/bindings/net/can/tcan4x5x.txt | 37 + drivers/net/can/m_can/Kconfig | 18 + drivers/net/can/m_can/Makefile | 4 +- drivers/net/can/m_can/m_can.c | 765 +++++++++--------- drivers/net/can/m_can/m_can_platform.c | 212 +++++ drivers/net/can/m_can/m_can_platform.h | 163 ++++ drivers/net/can/m_can/tcan4x5x.c | 458 +++++++++++ 7 files changed, 1253 insertions(+), 404 deletions(-) create mode 100644 Documentation/devicetree/bindings/net/can/tcan4x5x.txt create mode 100644 drivers/net/can/m_can/m_can_platform.c create mode 100644 drivers/net/can/m_can/m_can_platform.h create mode 100644 drivers/net/can/m_can/tcan4x5x.c -- 2.20.1.98.gecbdaf0899