All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wolfram Sang <wsa@the-dreams.de>
To: Bjorn Ardo <bjorn.ardo@axis.com>
Cc: "Patrick Williams" <alpawi@amazon.com>,
	"Björn Ardö" <bjornar@axis.com>,
	"Patrick Williams" <patrick@stwcx.xyz>,
	linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] i2c: slave-eeprom: initialize empty eeprom properly
Date: Mon, 20 Apr 2020 18:43:49 +0200	[thread overview]
Message-ID: <20200420164349.GD3721@ninjato> (raw)
In-Reply-To: <150599be-9125-4ab9-e2a6-e792b41910e6@axis.com>

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

On Wed, Oct 02, 2019 at 08:20:53AM +0200, Bjorn Ardo wrote:
> Hi,
> 
> 
> I sent in another patch earlier that added support for specifying a file in
> devicetree to initilize the eeprom from, corresponding to the case of
> pre-flashed eeprom. Maybe these two patches should be merged so this
> initialization is only done if no file is specified?

Yes, I agree.

> /BA
> 
> On 10/1/19 6:40 PM, Patrick Williams wrote:
> > The i2c-slave-eeprom driver emulates at24 class eeprom devices,
> > which come initialized with all 1s.  Do the same in the software
> > emulation.
> > 
> > Signed-off-by: Patrick Williams <alpawi@amazon.com>
> > ---
> >   drivers/i2c/i2c-slave-eeprom.c | 2 ++
> >   1 file changed, 2 insertions(+)
> > 
> > diff --git a/drivers/i2c/i2c-slave-eeprom.c b/drivers/i2c/i2c-slave-eeprom.c
> > index db9763cb4dae..efee56106251 100644
> > --- a/drivers/i2c/i2c-slave-eeprom.c
> > +++ b/drivers/i2c/i2c-slave-eeprom.c
> > @@ -131,6 +131,8 @@ static int i2c_slave_eeprom_probe(struct i2c_client *client, const struct i2c_de
> >   	if (!eeprom)
> >   		return -ENOMEM;
> > +	memset(eeprom->buffer, 0xFF, size);
> > +
> >   	eeprom->idx_write_cnt = 0;
> >   	eeprom->num_address_bytes = flag_addr16 ? 2 : 1;
> >   	eeprom->address_mask = size - 1;

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2020-04-20 16:43 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-01 16:40 [PATCH 1/2] i2c: slave-eeprom: initialize empty eeprom properly Patrick Williams
2019-10-01 16:40 ` Patrick Williams
2019-10-01 16:40 ` [PATCH 2/2] i2c: slave-eeprom: support additional models Patrick Williams
2019-10-01 16:40   ` Patrick Williams
2020-04-20 16:46   ` Wolfram Sang
2020-04-20 20:23     ` Patrick Williams
2019-10-02  6:20 ` [PATCH 1/2] i2c: slave-eeprom: initialize empty eeprom properly Bjorn Ardo
2020-04-20 16:43   ` Wolfram Sang [this message]
2020-04-20 20:24     ` Patrick Williams
2020-04-20 20:31     ` Patrick Williams
2020-04-20 20:53       ` Wolfram Sang
2020-04-21 12:03         ` Bjorn Ardo
2020-04-21 12:16           ` Wolfram Sang
2020-04-22  9:30             ` Bjorn Ardo
2020-04-22  9:36               ` Wolfram Sang
2020-04-24  9:06                 ` Bjorn Ardo

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=20200420164349.GD3721@ninjato \
    --to=wsa@the-dreams.de \
    --cc=alpawi@amazon.com \
    --cc=bjorn.ardo@axis.com \
    --cc=bjornar@axis.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=patrick@stwcx.xyz \
    /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.