linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bartosz Golaszewski <brgl@bgdev.pl>
To: Jean Delvare <jdelvare@suse.de>
Cc: Arnd Bergmann <arnd@arndb.de>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Linux I2C <linux-i2c@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] eeprom: New ee1004 driver for DDR4 memory
Date: Mon, 26 Feb 2018 15:32:35 +0100	[thread overview]
Message-ID: <CAMRc=McpCp5BQ61B6Gwd2OcuJq_aeT2fqwFRPF7xum-gn4yRXQ@mail.gmail.com> (raw)
In-Reply-To: <20180226152620.6740b458@endymion>

2018-02-26 15:26 GMT+01:00 Jean Delvare <jdelvare@suse.de>:
> Hi Bartosz,
>
> On Mon, 26 Feb 2018 14:40:42 +0100, Bartosz Golaszewski wrote:
>> 2018-02-26 10:20 GMT+01:00 Jean Delvare <jdelvare@suse.de>:
>> > The EEPROMs which hold the SPD data on DDR4 memory modules are no
>> > longer standard AT24C02-compatible EEPROMs. They are 512-byte EEPROMs
>> > which use only 1 I2C address for data access. You need to switch
>> > between the lower page and the upper page of data by sending commands
>> > on the SMBus.
>> >
>> > Signed-off-by: Jean Delvare <jdelvare@suse.de>
>> > ---
>> >  drivers/misc/eeprom/Kconfig  |   11 +
>> >  drivers/misc/eeprom/Makefile |    1
>> >  drivers/misc/eeprom/ee1004.c |  281 +++++++++++++++++++++++++++++++++++++++++++
>> >  3 files changed, 293 insertions(+)
>>
>> is there any reason not to use regmap as is done currently in at24? It
>> would spare you a lot of code.
>
> No specific reason, just the fact that I never used regmap before so
> the idea did not occur to me. I can give it a try, but my driver is
> already pretty simple so I'm curious if there's really anything to win.
> Let's see.
>

You wouldn't need to check i2c functionalities and could simplify the
read functions.

> Is there any documentation available on how to convert an existing
> driver to use regmap?
>

Take a look at the series from Heiner[1].

> --
> Jean Delvare
> SUSE L3 Support

I'm also seeing that you exported the sysfs eeprom attribute by hand.
I think you should register the driver as nvmem provider and set the
compat flag in nvmem config instead.

Thanks,
Bart

[1] http://patchwork.ozlabs.org/project/linux-i2c/list/?series=15614&state=*

  reply	other threads:[~2018-02-26 14:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-26  9:20 [PATCH] eeprom: New ee1004 driver for DDR4 memory Jean Delvare
2018-02-26 13:40 ` Bartosz Golaszewski
2018-02-26 14:26   ` Jean Delvare
2018-02-26 14:32     ` Bartosz Golaszewski [this message]
2018-10-02  9:43   ` Jean Delvare
2018-10-02 22:27     ` Greg Kroah-Hartman
  -- strict thread matches above, loose matches on Subject: below --
2017-11-20  9:35 Jean Delvare

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='CAMRc=McpCp5BQ61B6Gwd2OcuJq_aeT2fqwFRPF7xum-gn4yRXQ@mail.gmail.com' \
    --to=brgl@bgdev.pl \
    --cc=arnd@arndb.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=jdelvare@suse.de \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.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).