linux-can.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marc Kleine-Budde <mkl@pengutronix.de>
To: Wolfgang Grandegger <wg@grandegger.com>
Cc: linux-can@vger.kernel.org, andreas@gaisler.com, kernel@pengutronix.de
Subject: Re: [RFC: PATCH 5/5] can: sja1000_platform: add device tree bindings
Date: Fri, 05 Oct 2012 18:42:05 +0200	[thread overview]
Message-ID: <506F0DDD.4010101@pengutronix.de> (raw)
In-Reply-To: <506F0114.3010708@grandegger.com>

[-- Attachment #1: Type: text/plain, Size: 3886 bytes --]

On 10/05/2012 05:47 PM, Wolfgang Grandegger wrote:
> Hi Marc,
> 
> On 10/05/2012 04:39 PM, Marc Kleine-Budde wrote:
>> This patch add device tree bindings, the are ported from the
> 
> typo?

yes.

> 
>> sja1000_of_platform driver:
>>
>>     Copyright (C) 2008-2009 Wolfgang Grandegger <wg@grandegger.com>
>>
>> The use of "of_get_property()" has been converted to "of_property_read_u32()"
>> to be endianess safe.
>>
>> Cc: Wolfgang Grandegger <wg@grandegger.com>
>> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
>> ---
>>  drivers/net/can/sja1000/sja1000_platform.c |   91 +++++++++++++++++++++++++---
>>  1 file changed, 84 insertions(+), 7 deletions(-)
>>
>> diff --git a/drivers/net/can/sja1000/sja1000_platform.c b/drivers/net/can/sja1000/sja1000_platform.c
>> index 6260209..91f7404 100644
>> --- a/drivers/net/can/sja1000/sja1000_platform.c
>> +++ b/drivers/net/can/sja1000/sja1000_platform.c
>> @@ -1,6 +1,7 @@
>>  /*
>>   * Copyright (C) 2005 Sascha Hauer, Pengutronix
>> - * Copyright (C) 2007 Wolfgang Grandegger <wg@grandegger.com>
>> + * Copyright (C) 2007-2009 Wolfgang Grandegger <wg@grandegger.com>
>> + * Copyright (C) 2012 Marc Kleine-Budde <mkl@pengutronix.de>
>>   *
>>   * This program is free software; you can redistribute it and/or modify
>>   * it under the terms of the version 2 of the GNU General Public License
>> @@ -11,15 +12,28 @@
>>   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
>>   * GNU General Public License for more details.
>>   *
>> - * You should have received a copy of the GNU General Public License
>> - * along with this program; if not, write to the Free Software
>> - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
>> + * This is a generic driver for SJA1000 chips on the OpenFirmware
>> + * platform bus found on embedded systems. You need a SJA1000 CAN node
>> + * definition in your flattened device tree source (DTS) file similar
>> + * to:
>> + *
>> + *   can@3,100 {
>> + *           compatible = "nxp,sja1000";
>> + *           reg = <3 0x100 0x80>;
>> + *           interrupts = <2 0>;
>> + *           interrupt-parent = <&mpic>;
>> + *           nxp,external-clock-frequency = <16000000>;
>> + *   };
>> + *
>> + * See "Documentation/devicetree/bindings/net/can/sja1000.txt" for
>> + * further information.
>>   */
>>  
>>  #include <linux/kernel.h>
>>  #include <linux/module.h>
>>  #include <linux/interrupt.h>
>>  #include <linux/netdevice.h>
>> +#include <linux/of.h>
>>  #include <linux/delay.h>
>>  #include <linux/pci.h>
>>  #include <linux/platform_device.h>
>> @@ -30,6 +44,8 @@
>>  
>>  #include "sja1000.h"
>>  
>> +#define SP_DEFAULT_CLOCK	(16000000 / 2)
>> +
>>  MODULE_AUTHOR("Sascha Hauer <s.hauer@pengutronix.de>");
>>  MODULE_DESCRIPTION("Socket-CAN driver for SJA1000 on the platform bus");
>>  MODULE_LICENSE("GPL v2");
>> @@ -72,6 +88,61 @@ static void __devinit sp_probe_pdata(struct sja1000_priv *priv, const struct sja
>>  	priv->cdr = pdata->cdr;
>>  }
>>  
>> +#ifdef CONFIG_OF
> 
> Do we still need that dependency?

We don't need it in order to compile without OF support, but I think it
will make the module a bit bigger. However I'll check this.

> Thanks for cleaning up! Unfortunately, I do not have a board with a
> platform sja1000. Well, I have a phyCORE-PXA270, but I'm not sure if I
> get it working with the mainline kernel quickly.

I'm more interested if the powerpc board is still working. The one you
wrote the of platform driver in the first place.

Marc

-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 259 bytes --]

  reply	other threads:[~2012-10-05 16:42 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-05 14:39 [RFC: PATCH 1/5] can: sja1000_platform Marc Kleine-Budde
2012-10-05 14:39 ` [RFC: PATCH 1/5] can: sja1000_platform: add __dev{init,exit} annotations Marc Kleine-Budde
2012-10-05 14:39 ` [RFC: PATCH 2/5] can: sja1000_platform: convert ioremap_nocache to devm_request_and_ioremap Marc Kleine-Budde
2012-10-05 14:39 ` [RFC: PATCH 3/5] can: sja1000_platform: replace DRV_NAME by KBUILD_MODNAME Marc Kleine-Budde
2012-10-05 14:39 ` [RFC: PATCH 4/5] can: sja1000_platform: factor out initialization from platform data Marc Kleine-Budde
2012-10-05 14:39 ` [RFC: PATCH 5/5] can: sja1000_platform: add device tree bindings Marc Kleine-Budde
2012-10-05 15:47   ` Wolfgang Grandegger
2012-10-05 16:42     ` Marc Kleine-Budde [this message]
2012-10-05 16:58       ` Wolfgang Grandegger
2012-10-08  9:16 ` [RFC: PATCH 1/5] can: sja1000_platform Andreas Larsson
2012-10-08 12:19   ` Marc Kleine-Budde
2012-10-08 12:50     ` Andreas Larsson
2012-10-09 13:30   ` Andreas Larsson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=506F0DDD.4010101@pengutronix.de \
    --to=mkl@pengutronix.de \
    --cc=andreas@gaisler.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-can@vger.kernel.org \
    --cc=wg@grandegger.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).