All of lore.kernel.org
 help / color / mirror / Atom feed
From: jacmet@sunsite.dk (Peter Korsgaard)
To: lm-sensors@vger.kernel.org
Subject: [lm-sensors] [PATCH] OpenCores I2C bus driver
Date: Thu, 18 May 2006 17:18:58 +0000	[thread overview]
Message-ID: <87hd3n1cal.fsf@LKG7F3A44.lan> (raw)
In-Reply-To: <874q0n1505.fsf@sleipner.barco.com>

>>>>> "Rudolf" = Rudolf Marek <r.marek at sh.cvut.cz> writes:

Hi,

 Rudolf> Sorry for delay we all had lot of other stuff to do. I
 Rudolf> checked your driver and it seems very good. Please check my
 Rudolf> comments in the code.

No problem, I've had a busy week as well..

Perhaps worth noticing: This is not the latest version of the
patch. Andrew added it to -mm after I posted it and a few small
fixes/cleanups were done. On the 27th of April it was forwarded to
Greg and dropped from -mm.

I'm afraid I've lost track of it since :/ I expect Greg to wait until
2.6.17 gets released before pushing it upstream, but I don't see it in
his git tree..

Greg, where are you hiding it? ;)

 >> +config I2C_OCORES
 >> +	tristate "OpenCores I2C Controller"
 >> +	depends on I2C

 Rudolf> Really no experimental? How long is driver used?

I've been using it for a month or two (on 2 different designs) and the
core logic is based on a eCos driver that I have been using for around
a year.

But we can mark it experimental if you want, I don't feel strongly
about it.

 >> obj-$(CONFIG_I2C_VIA)		+= i2c-via.o
 >> obj-$(CONFIG_I2C_VIAPRO)	+= i2c-viapro.o
 >> obj-$(CONFIG_I2C_VOODOO3)	+= i2c-voodoo3.o
 >> +obj-$(CONFIG_I2C_OCORES)	+= i2c-ocores.o

 Rudolf> I think rest of files is alphabetic order

Ok, I'll fix that.

 >> + * Peter Korsgaard <jacmet at sunsite.dk>

 Rudolf> Should have (C) and year

Really? Isn't that just extra noise that's bound to get out of date?

 >> +	/* make sure the device is disabled */
 >> +	oc_setreg(i2c, OCI2C_CONTROL, 0);

 Rudolf> Well I started to read the driver from a flow and this is the
 Rudolf> first occurrence to write to some register :).

There's also regiser access in ocores_process.

 Rudolf> I think much better handling of reserved bits is to read them
 Rudolf> from device change bits I know and then write all back.

Yes, that could be done for CONTROL as it's r/w - I'll change that.

 Rudolf> I'm also surprised that the device has no ID/revision regs
 Rudolf> which might be handy for future extensions

Yeah, but as it's a quite simple device (implemented in FPGA) that was
probably considered overkill.

 >> +	prescale = (pdata->clock_khz / (5*100)) - 1;

 Rudolf> No checks for evil values?

Currently not. It would be a bit hard to define what a valid value
is. Do you think it's needed? This is data provided by the platform
code just like the base address and IRQ number (that we also don't
validate).

 >> +	oc_setreg(i2c, OCI2C_CMD,     OCI2C_CMD_IACK);
 >> +	oc_setreg(i2c, OCI2C_CONTROL, 0xc0);

 Rudolf> and here again

I'll add defines for the CONTROL bits and only change the needed bits.

Thanks for your comments!

-- 
Bye, Peter Korsgaard


  parent reply	other threads:[~2006-05-18 17:18 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-21 12:34 [lm-sensors] [PATCH] OpenCores I2C bus driver Peter Korsgaard
2006-05-14  9:09 ` Rudolf Marek
2006-05-18 17:18 ` Peter Korsgaard [this message]
2006-05-18 20:37 ` Greg KH
2006-05-19  5:00 ` Peter Korsgaard
2006-05-20  6:05 ` Peter Korsgaard
2006-05-20  8:59 ` Jean Delvare
2006-05-20 16:56 ` Peter Korsgaard
2006-05-27 15:52 ` Peter Korsgaard
2006-06-04 15:00 ` Jean Delvare
2006-06-06 13:49 ` Peter Korsgaard
2006-06-06 17:28 ` Jean Delvare
  -- strict thread matches above, loose matches on Subject: below --
2006-04-21  9:05 Peter Korsgaard
2006-04-21 21:19 ` [lm-sensors] " Jeff Garzik

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=87hd3n1cal.fsf@LKG7F3A44.lan \
    --to=jacmet@sunsite.dk \
    --cc=lm-sensors@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 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.