linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: alexandre.belloni@free-electrons.com (Alexandre Belloni)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH linux-next 2/2] mfd: flexcom: add a driver for Atmel Flexible Serial Communication Unit
Date: Mon, 15 Jun 2015 19:50:59 +0200	[thread overview]
Message-ID: <20150615175059.GE17679@piout.net> (raw)
In-Reply-To: <e85ceae28a0b382b12b809ac7cca891fcb7ac846.1434386119.git.cyrille.pitchen@atmel.com>

Hi,

On 15/06/2015 at 18:38:05 +0200, Cyrille Pitchen wrote :
> +	err = of_property_read_string(pdev->dev.of_node,
> +				      "atmel,flexcom-mode", &mode);
> +	if (err)
> +		return err;
> +
> +	if (!strcmp(mode, "usart"))
> +		mr = FX_MR_USART;
> +	else if (!strcmp(mode, "spi"))
> +		mr = FX_MR_SPI;
> +	else if (!strcmp(mode, "twi") || !strcmp(mode, "i2c"))
> +		mr = FX_MR_TWI;
> +	else
> +		return -EINVAL;
> +
> +	clk_prepare_enable(clk);
> +	version = __raw_readl(map + FX_VERSION);
> +	__raw_writel(mr, map + FX_MR);
> +	clk_disable_unprepare(clk);
> +
> +	dev_info(&pdev->dev, "version: %#x\n", version);
> +

I would also print the selected mode for debugging convenience,
especially if this is used with device tree overlays.


-- 
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

  parent reply	other threads:[~2015-06-15 17:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-15 16:38 [PATCH linux-next 0/2] mfd: flexcom: add a driver for Flexcom Cyrille Pitchen
2015-06-15 16:38 ` [PATCH linux-next 1/2] mfd: devicetree: add bindings for Atmel Flexcom Cyrille Pitchen
2015-06-15 17:27   ` Boris Brezillon
2015-06-15 16:38 ` [PATCH linux-next 2/2] mfd: flexcom: add a driver for Atmel Flexible Serial Communication Unit Cyrille Pitchen
2015-06-15 17:32   ` Boris Brezillon
2015-06-15 17:50   ` Alexandre Belloni [this message]
2015-06-16  7:34   ` Paul Bolle

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=20150615175059.GE17679@piout.net \
    --to=alexandre.belloni@free-electrons.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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).