All of lore.kernel.org
 help / color / mirror / Atom feed
From: Heiko Schocher <hs@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 0/3] Bring in new I2C framework
Date: Mon, 29 Oct 2012 10:53:10 +0100	[thread overview]
Message-ID: <508E5206.6060704@denx.de> (raw)
In-Reply-To: <20121026184445.GF31793@bill-the-cat>

Hello Tom,

On 26.10.2012 20:44, Tom Rini wrote:
> On Thu, Oct 25, 2012 at 02:37:08PM -0700, Simon Glass wrote:
>
> [snip]
>> Later, I wonder whether the concept of a 'current' i2c bus should be
>> maintained by the command line interpreter, rather than the i2c
>> system. Because to be honest, most of the drivers I see have to save
>> the current bus number, set the current bus, do the operation, then
>> set the bus back how they found it (to preserve whatever the user
>> things is the current bus).
>
> I agree.  Lets move the notion of "current" to cmd_i2c and make
> everything internally pass around the bus to operate on.  Or try going
> down this path and find a fatal problem :)

As I wrote to simon, stephen, this is an independent problem from the
new framework patches!

- There are two steps to do:
   - save the curent cmdline bus in a variable, and call i2c_set_bus_num()
     before you call i2c_* from the commandline, get rid of the store/restore
     calls ...

   - change the i2c API to pass the i2c bus in the i2c_* functions
     -> in the new i2c framework, i2c_set_bus() gets static and the
        gd->current_i2c_bus is used only in i2c_core.c

This two steps can be done in one step, but the second step is complicated
enough, so it is better to do it in two steps (I think)!

Waiting for patches ;-)

The i2c framework change is independent from this! The current_i2c_bus is
used i2c_core internally for storing the current active i2c bus, based
on the idea of having only one i2c bus active in U-Boot, see therefore
the U-Boot principle:

http://www.denx.de/wiki/view/U-Boot/DesignPrinciples#2_Keep_it_Fast
"Initialize devices only when they are needed within U-Boot, i.e. don't
initialize the Ethernet interface(s) unless U-Boot performs" [...]", etc.
(and don't forget to shut down these devices after using them -
otherwise nasty things may happen when you try to boot your OS). "

therefore the "current i2c bus" is needed! If we want to drop this
"U-Boot principle", we can get rid of current_i2c_bus ... (Ok, currently
U-Boot do not deactivate not used i2c adapters ...)

bye,
Heiko
-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

  reply	other threads:[~2012-10-29  9:53 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-22 17:40 [U-Boot] [PATCH 0/3] Bring in new I2C framework Heiko Schocher
2012-10-22 17:40 ` [U-Boot] [PATCH 1/3] i2c: add i2c_core and prepare for new multibus support Heiko Schocher
2012-10-22 17:40 ` [U-Boot] [PATCH 2/3] i2c: common changes for multibus/multiadapter support Heiko Schocher
2012-10-22 22:16   ` Henrik Nordström
2012-10-23  3:25     ` Heiko Schocher
2012-10-22 17:40 ` [U-Boot] [PATCH 3/3] i2c, soft-i2c: switch to new " Heiko Schocher
2012-10-25 21:37 ` [U-Boot] [PATCH 0/3] Bring in new I2C framework Simon Glass
2012-10-26  5:48   ` Heiko Schocher
2012-10-26 16:07     ` Stephen Warren
2012-10-29  9:47       ` Heiko Schocher
2012-10-29 15:34         ` Stephen Warren
2012-10-29 15:56           ` Simon Glass
2012-10-30  5:57           ` Heiko Schocher
2012-10-30 16:50             ` Stephen Warren
2012-10-30 17:22               ` Simon Glass
2012-10-31  5:02                 ` Heiko Schocher
2012-10-31  5:20                 ` Tom Rini
2012-10-26 16:08     ` Simon Glass
2012-10-29  9:44       ` Heiko Schocher
2012-10-29 13:48         ` Simon Glass
2012-10-30  5:44           ` Heiko Schocher
2012-10-26 18:44   ` Tom Rini
2012-10-29  9:53     ` Heiko Schocher [this message]
2012-10-30 22:38       ` Tom Rini
  -- strict thread matches above, loose matches on Subject: below --
2012-01-17  7:12 Simon Glass
2012-01-17  8:30 ` Heiko Schocher

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=508E5206.6060704@denx.de \
    --to=hs@denx.de \
    --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.