All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Renaud Barbier <renaud.barbier@ge.com>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 2/3] Freescale I2C driver
Date: Tue, 28 Aug 2012 11:19:13 +0200	[thread overview]
Message-ID: <20120828091913.GF26594@pengutronix.de> (raw)
In-Reply-To: <1345648133-31721-3-git-send-email-renaud.barbier@ge.com>

On Wed, Aug 22, 2012 at 04:08:52PM +0100, Renaud Barbier wrote:
> This patch introduces the Freescale I2C driver along with its configuration
> and build files.
> The header file asm/fsl_i2c.h is updated with register offsets and the
> structure mapping the i2c registers is removed.
> 
> Signed-off-by: Renaud Barbier <renaud.barbier@ge.com>
> ---
>  arch/ppc/include/asm/fsl_i2c.h |   80 ++++------
>  drivers/i2c/busses/Kconfig     |    4 +
>  drivers/i2c/busses/Makefile    |    1 +
>  drivers/i2c/busses/i2c-fsl.c   |  356 ++++++++++++++++++++++++++++++++++++++++
>  4 files changed, 393 insertions(+), 48 deletions(-)
>  create mode 100644 drivers/i2c/busses/i2c-fsl.c
> 
> diff --git a/arch/ppc/include/asm/fsl_i2c.h b/arch/ppc/include/asm/fsl_i2c.h

Please remove this file completely. The i2c registers should be defined in the
driver.


> index 4f71341..62b077d 100644
> --- a/arch/ppc/include/asm/fsl_i2c.h
> +++ b/arch/ppc/include/asm/fsl_i2c.h
> @@ -1,6 +1,7 @@
>  /*
>   * Freescale I2C Controller
>   *
> + * Copyright 2012 GE Intelligent Platform, Inc.
>   * Copyright 2006 Freescale Semiconductor, Inc.
>   *
>   * Based on earlier versions by Gleb Natapov <gnatapov@mrv.com>,
> @@ -32,55 +33,38 @@
>  
>  #include <asm/types.h>
>  
> -typedef struct fsl_i2c {
> +#define I2C1_BASE_ADDR (CFG_IMMR + 0x3000)
> +#define I2C2_BASE_ADDR (CFG_IMMR + 0x3100)
>  
> -	u8 adr;		/* I2C slave address */
> -	u8 res0[3];
> -#define I2C_ADR		0xFE
> -#define I2C_ADR_SHIFT	1
> -#define I2C_ADR_RES	~(I2C_ADR)
> +#define FSL_I2C_ADR		0x00
> +#define FSL_I2C_FDR		0x04
> +#define FSL_I2C_CR		0x08
> +#define		I2C_CR_MEN	0x80
> +#define		I2C_CR_MIEN	0x40
> +#define		I2C_CR_MSTA	0x20
> +#define		I2C_CR_MTX	0x10
> +#define		I2C_CR_TXAK	0x08
> +#define		I2C_CR_RSTA	0x04
> +#define		I2C_CR_BCST	0x01
> +#define FSL_I2C_SR		0x0C
> +#define		I2C_SR_MCF	0x80
> +#define		I2C_SR_MAAS	0x40
> +#define		I2C_SR_MBB	0x20
> +#define		I2C_SR_MAL	0x10
> +#define		I2C_SR_BCSTM	0x08
> +#define		I2C_SR_SRW	0x04
> +#define		I2C_SR_MIF	0x02
> +#define		I2C_SR_RXAK	0x01
> +#define FSL_I2C_DR		0x10
> +#define FSL_I2C_DFSRR		0x14

These defines look awfully familiar. Can we use
drivers/i2c/busses/i2c-imx.c instead of adding a new driver?

Sascha


-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2012-08-28  9:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-22 15:08 [PATCH 0/3] Freescale I2C driver Renaud Barbier
2012-08-22 15:08 ` [PATCH 1/3] mpc85xx: i2c frequency Renaud Barbier
2012-08-22 15:08 ` [PATCH 2/3] Freescale I2C driver Renaud Barbier
2012-08-28  9:19   ` Sascha Hauer [this message]
2012-08-29 13:59     ` Renaud Barbier
2012-08-29 14:01       ` Sascha Hauer
2012-08-22 15:08 ` [PATCH 3/3] ppc: p2020rdb i2c support Renaud Barbier

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=20120828091913.GF26594@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=renaud.barbier@ge.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.