From patchwork Fri Nov 7 14:49:17 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roger Quadros X-Patchwork-Id: 40424 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f72.google.com (mail-la0-f72.google.com [209.85.215.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id BCF52240F7 for ; Fri, 7 Nov 2014 14:50:50 +0000 (UTC) Received: by mail-la0-f72.google.com with SMTP id mc6sf3096645lab.3 for ; Fri, 07 Nov 2014 06:50:49 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe:content-type; bh=Hpw1MI88OQacZIrX9RR6Uvcse57eB76GHRe4PWD3Y3k=; b=aQakeLDQxhLCEr9uH7gl2XZjhzM9VVFRZpWkTdi0w5MN/wU5/2LrQWyeP9tTHAIzSF yFZzErNBf2vQT8T0cPh4S5T1ExdkvGZdp8M8Gy/TyjVMzwryLCmQe2y1CEct6xk1rYMg Nv5q+dTdqZhqwVmfbDy9IipYYW60lzY+SWsIhIARf8P8NjpB2gnNpp7JPAvLwyZ0i6Ro q5wb/Kc5eOZQT7Wa4q1W8ptMnV7pTU0C3HPsT7uk+fl0WT8brDWLrzu9KtGZdX1elZXq ZbOirH8UxzXsq7XaZ/gcVXhbPKC9/3TSctdLV2WIaD6eoscza8QJF+jCICKtHsga68cS xkXQ== X-Gm-Message-State: ALoCoQm6XCkXKPgNTa1vn8kbp/IN2MeoEm+9A/YI+XpmhVFIWjMNWKBzHHCneKvtt36Je8Tj1Arz X-Received: by 10.112.180.71 with SMTP id dm7mr137188lbc.18.1415371849748; Fri, 07 Nov 2014 06:50:49 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.9.168 with SMTP id a8ls201895lab.55.gmail; Fri, 07 Nov 2014 06:50:49 -0800 (PST) X-Received: by 10.112.97.231 with SMTP id ed7mr11773383lbb.12.1415371849248; Fri, 07 Nov 2014 06:50:49 -0800 (PST) Received: from mail-lb0-f178.google.com (mail-lb0-f178.google.com. [209.85.217.178]) by mx.google.com with ESMTPS id qs7si15311875lbb.76.2014.11.07.06.50.49 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 07 Nov 2014 06:50:49 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.178 as permitted sender) client-ip=209.85.217.178; Received: by mail-lb0-f178.google.com with SMTP id f15so3116599lbj.9 for ; Fri, 07 Nov 2014 06:50:49 -0800 (PST) X-Received: by 10.152.42.226 with SMTP id r2mr11648215lal.29.1415371849134; Fri, 07 Nov 2014 06:50:49 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.184.201 with SMTP id ew9csp210552lbc; Fri, 7 Nov 2014 06:50:48 -0800 (PST) X-Received: by 10.70.33.195 with SMTP id t3mr12623487pdi.135.1415371846993; Fri, 07 Nov 2014 06:50:46 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id qf7si9134006pbb.205.2014.11.07.06.50.46 for ; Fri, 07 Nov 2014 06:50:46 -0800 (PST) Received-SPF: none (google.com: netdev-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753066AbaKGOuo (ORCPT + 3 others); Fri, 7 Nov 2014 09:50:44 -0500 Received: from devils.ext.ti.com ([198.47.26.153]:48041 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752925AbaKGOuI (ORCPT ); Fri, 7 Nov 2014 09:50:08 -0500 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id sA7EnnE6010636; Fri, 7 Nov 2014 08:49:49 -0600 Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id sA7Enn46013060; Fri, 7 Nov 2014 08:49:49 -0600 Received: from dlep32.itg.ti.com (157.170.170.100) by DFLE72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.3.174.1; Fri, 7 Nov 2014 08:49:48 -0600 Received: from localhost.localdomain (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id sA7EnX7F007870; Fri, 7 Nov 2014 08:49:45 -0600 From: Roger Quadros To: , CC: , , , , , , , , , , , , Roger Quadros Subject: [PATCH v4 3/8] net: can: c_can: Add RAMINIT register information to driver data Date: Fri, 7 Nov 2014 16:49:17 +0200 Message-ID: <1415371762-29885-4-git-send-email-rogerq@ti.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1415371762-29885-1-git-send-email-rogerq@ti.com> References: <1415371762-29885-1-git-send-email-rogerq@ti.com> MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: netdev@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: rogerq@ti.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.178 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Some platforms (e.g. TI) need special RAMINIT register handling. Provide a way to store RAMINIT register description in driver data. Signed-off-by: Roger Quadros --- drivers/net/can/c_can/c_can.h | 6 ++++++ drivers/net/can/c_can/c_can_platform.c | 1 + 2 files changed, 7 insertions(+) diff --git a/drivers/net/can/c_can/c_can.h b/drivers/net/can/c_can/c_can.h index 26c975d..3c305a1 100644 --- a/drivers/net/can/c_can/c_can.h +++ b/drivers/net/can/c_can/c_can.h @@ -171,6 +171,12 @@ enum c_can_dev_id { struct c_can_driver_data { enum c_can_dev_id id; + + /* RAMINIT register description. Optional. */ + u8 num_can; /* Number of CAN instances on the SoC */ + u8 *raminit_start_bits; /* Array of START bit positions */ + u8 *raminit_done_bits; /* Array of DONE bit positions */ + bool raminit_pulse; /* If set, sets and clears START bit (pulse) */ }; /* c_can private data structure */ diff --git a/drivers/net/can/c_can/c_can_platform.c b/drivers/net/can/c_can/c_can_platform.c index 1546c2b..20deb67 100644 --- a/drivers/net/can/c_can/c_can_platform.c +++ b/drivers/net/can/c_can/c_can_platform.c @@ -250,6 +250,7 @@ static int c_can_plat_probe(struct platform_device *pdev) } priv = netdev_priv(dev); + switch (drvdata->id) { case BOSCH_C_CAN: priv->regs = reg_map_c_can;