From patchwork Tue Nov 4 10:20:56 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roger Quadros X-Patchwork-Id: 40103 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f70.google.com (mail-wg0-f70.google.com [74.125.82.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5954021894 for ; Tue, 4 Nov 2014 10:22:10 +0000 (UTC) Received: by mail-wg0-f70.google.com with SMTP id x13sf7280760wgg.9 for ; Tue, 04 Nov 2014 02:22:09 -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=INEy2I4HCZSBa9g1MeyG9kr0e9eyaucv3fyJMes5EVY=; b=Dm6RgeJGMP6qM4k6nbZT/vZGVWsCHbjsKkhHzL4WbmaYxBAKlJRXOUjFlhMukfi4FO WwkC9xNHDG4RDSWgfbMMZ4TkS5Hf/4y4By6VHw1NB9BCHm5Mag9SSWdcOzTMgARRLEUC 8Zm1jUzr9sDsvHhObxE+MxxL9NwSx8+1stJMwY/ysFAVWk2e4MIQd8IT3psoGmvIfBOj 3i/6Hsn3NUdJqFqnERnpcpOlPsf7p0bPqXarX/ChRglBgJZRdU4rjFVq2980GjGKN0Fz zS0KneQrAAs/9Y8wO6qmw0mMesXRcXmVyX6LD6SGR2gdWQawasLWAidkMZQxjq1TbYjd wJQQ== X-Gm-Message-State: ALoCoQltplbRwFQvse753gVN4kwkwayLdohy+HpULji1C8j+tEKAA+7pkHdRLyRGgUYgbuJsoRFq X-Received: by 10.112.154.194 with SMTP id vq2mr1751074lbb.10.1415096529516; Tue, 04 Nov 2014 02:22:09 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.206.104 with SMTP id ln8ls168920lac.22.gmail; Tue, 04 Nov 2014 02:22:09 -0800 (PST) X-Received: by 10.152.1.74 with SMTP id 10mr29541492lak.61.1415096529339; Tue, 04 Nov 2014 02:22:09 -0800 (PST) Received: from mail-lb0-f181.google.com (mail-lb0-f181.google.com. [209.85.217.181]) by mx.google.com with ESMTPS id k10si36777788lbp.126.2014.11.04.02.22.09 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 04 Nov 2014 02:22:09 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.181 as permitted sender) client-ip=209.85.217.181; Received: by mail-lb0-f181.google.com with SMTP id l4so4120362lbv.26 for ; Tue, 04 Nov 2014 02:22:09 -0800 (PST) X-Received: by 10.152.120.199 with SMTP id le7mr35180172lab.67.1415096527936; Tue, 04 Nov 2014 02:22:07 -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 ew9csp92826lbc; Tue, 4 Nov 2014 02:22:07 -0800 (PST) X-Received: by 10.70.41.13 with SMTP id b13mr48580138pdl.20.1415096526372; Tue, 04 Nov 2014 02:22:06 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ck3si17614882pbb.107.2014.11.04.02.22.05 for ; Tue, 04 Nov 2014 02:22:06 -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 S1752847AbaKDKWC (ORCPT + 3 others); Tue, 4 Nov 2014 05:22:02 -0500 Received: from devils.ext.ti.com ([198.47.26.153]:46360 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752674AbaKDKV4 (ORCPT ); Tue, 4 Nov 2014 05:21:56 -0500 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id sA4ALVnK029795; Tue, 4 Nov 2014 04:21:31 -0600 Received: from DLEE70.ent.ti.com (dlemailx.itg.ti.com [157.170.170.113]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id sA4ALUXl028829; Tue, 4 Nov 2014 04:21:30 -0600 Received: from dlep32.itg.ti.com (157.170.170.100) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.3.174.1; Tue, 4 Nov 2014 04:21:29 -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 sA4ALEGD020969; Tue, 4 Nov 2014 04:21:26 -0600 From: Roger Quadros To: , CC: , , , , , , , , , , , , Roger Quadros Subject: [PATCH v3 3/8] net: can: c_can: Add RAMINIT register information to driver data Date: Tue, 4 Nov 2014 12:20:56 +0200 Message-ID: <1415096461-25576-4-git-send-email-rogerq@ti.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1415096461-25576-1-git-send-email-rogerq@ti.com> References: <1415096461-25576-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.181 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 | 2 ++ 2 files changed, 8 insertions(+) diff --git a/drivers/net/can/c_can/c_can.h b/drivers/net/can/c_can/c_can.h index 26c975d..c3b2108 100644 --- a/drivers/net/can/c_can/c_can.h +++ b/drivers/net/can/c_can/c_can.h @@ -171,6 +171,11 @@ enum c_can_dev_id { struct c_can_driver_data { enum c_can_dev_id id; + + /* RAMINIT register description. Optional. */ + u8 raminit_start_bit; /* START bit position in RAMINIT reg. */ + u8 raminit_done_bit; /* DONE bit position in RAMINIT reg. */ + bool raminit_pulse; /* If set, sets and clears START bit (pulse) */ }; /* c_can private data structure */ @@ -196,6 +201,7 @@ struct c_can_priv { u32 comm_rcv_high; u32 rxmasked; u32 dlc[C_CAN_MSG_OBJ_TX_NUM]; + const struct c_can_driver_data *drvdata; }; struct net_device *alloc_c_can_dev(void); diff --git a/drivers/net/can/c_can/c_can_platform.c b/drivers/net/can/c_can/c_can_platform.c index 1546c2b..11946e8 100644 --- a/drivers/net/can/c_can/c_can_platform.c +++ b/drivers/net/can/c_can/c_can_platform.c @@ -250,6 +250,8 @@ static int c_can_plat_probe(struct platform_device *pdev) } priv = netdev_priv(dev); + priv->drvdata = drvdata; + switch (drvdata->id) { case BOSCH_C_CAN: priv->regs = reg_map_c_can;