All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Simek <michal.simek@xilinx.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 4/4] i2c: i2c-cdns: No need for dedicated probe function
Date: Mon, 2 Jan 2017 15:28:08 +0100	[thread overview]
Message-ID: <2b04e50d-ffab-a700-31fa-95aaa7b6596d@xilinx.com> (raw)
In-Reply-To: <1482878794-30009-4-git-send-email-moritz.fischer@ettus.com>

Hi, +Siva

do you know why this was done in this way? I know I was playing with
similar patch and using xfer function but can't remember why it was
failing.

Thanks,
Michal

On 27.12.2016 23:46, Moritz Fischer wrote:
> The generic probe code in dm works, so get rid of the leftover cruft.
> 
> Signed-off-by: Moritz Fischer <moritz.fischer@ettus.com>
> Cc: Heiko Schocher <hs@denx.de>
> Cc: Michal Simek <michal.simek@xilinx.com>
> Cc: u-boot at lists.denx.de
> ---
>  drivers/i2c/i2c-cdns.c | 21 ---------------------
>  1 file changed, 21 deletions(-)
> 
> diff --git a/drivers/i2c/i2c-cdns.c b/drivers/i2c/i2c-cdns.c
> index 4a46dbf..cd5cce0 100644
> --- a/drivers/i2c/i2c-cdns.c
> +++ b/drivers/i2c/i2c-cdns.c
> @@ -226,26 +226,6 @@ static int cdns_i2c_set_bus_speed(struct udevice *dev, unsigned int speed)
>  	return 0;
>  }
>  
> -/* Probe to see if a chip is present. */
> -static int cdns_i2c_probe_chip(struct udevice *bus, uint chip_addr,
> -				uint chip_flags)
> -{
> -	struct i2c_cdns_bus *i2c_bus = dev_get_priv(bus);
> -	struct cdns_i2c_regs *regs = i2c_bus->regs;
> -
> -	/* Attempt to read a byte */
> -	setbits_le32(&regs->control, CDNS_I2C_CONTROL_CLR_FIFO |
> -		CDNS_I2C_CONTROL_RW);
> -	clrbits_le32(&regs->control, CDNS_I2C_CONTROL_HOLD);
> -	writel(0xFF, &regs->interrupt_status);
> -	writel(chip_addr, &regs->address);
> -	writel(1, &regs->transfer_size);
> -
> -	return (cdns_i2c_wait(regs, CDNS_I2C_INTERRUPT_COMP |
> -		CDNS_I2C_INTERRUPT_NACK) &
> -		CDNS_I2C_INTERRUPT_COMP) ? 0 : -ETIMEDOUT;
> -}
> -
>  static int cdns_i2c_write_data(struct i2c_cdns_bus *i2c_bus, u32 addr, u8 *data,
>  			       u32 len)
>  {
> @@ -453,7 +433,6 @@ static int cdns_i2c_ofdata_to_platdata(struct udevice *dev)
>  
>  static const struct dm_i2c_ops cdns_i2c_ops = {
>  	.xfer = cdns_i2c_xfer,
> -	.probe_chip = cdns_i2c_probe_chip,
>  	.set_bus_speed = cdns_i2c_set_bus_speed,
>  };
>  
> 

  reply	other threads:[~2017-01-02 14:28 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-27 22:46 [U-Boot] [PATCH 1/4] i2c: i2c-cdns: Detect unsupported sequences for rev 1.0 Moritz Fischer
2016-12-27 22:46 ` [U-Boot] [PATCH 2/4] i2c: i2c-cdns: Reorder timeout loop for interrupt waiting Moritz Fischer
2017-01-02 13:43   ` Michal Simek
2016-12-27 22:46 ` [U-Boot] [PATCH 3/4] i2c: i2c-cdns: Implement workaround for hold quirk of the rev 1.0 Moritz Fischer
2017-01-02 14:31   ` Michal Simek
2016-12-27 22:46 ` [U-Boot] [PATCH 4/4] i2c: i2c-cdns: No need for dedicated probe function Moritz Fischer
2017-01-02 14:28   ` Michal Simek [this message]
2017-01-02 14:29 ` [U-Boot] [PATCH 1/4] i2c: i2c-cdns: Detect unsupported sequences for rev 1.0 Michal Simek
2017-01-02 19:35   ` Moritz Fischer

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=2b04e50d-ffab-a700-31fa-95aaa7b6596d@xilinx.com \
    --to=michal.simek@xilinx.com \
    --cc=u-boot@lists.denx.de \
    /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.