linux-um archives
 help / color / mirror / Atom feed
From: "Peter Hüwe" <PeterHuewe@gmx.de>
To: Jean Delvare <khali@linux-fr.org>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>,
	Richard Weinberger <richard@nod.at>,
	user-mode-linux-devel@lists.sourceforge.net
Subject: Re: [uml-devel] Emulate I2C subsystem/slaves
Date: Sun, 9 Sep 2012 14:15:02 +0200	[thread overview]
Message-ID: <201209091415.02460.PeterHuewe@gmx.de> (raw)
In-Reply-To: <20120909132838.51b6c434@endymion.delvare>

Am Sonntag, 9. September 2012, 13:28:38 schrieb Jean Delvare:
> Thanks for the info. I thought UML was no longer used with all the
> virtualization solutions available, but apparently I was wrong.
I guess it's mainly used for sandboxing, testing and development ;)


> My bet is that all I2C bus drivers do use I/O or memory mapped
> operations directly or indirectly, except i2c-stub. So it would
> probably make more sense, and be a less intrusive change, to move the
> HAS_IOMEM dependency to drivers/i2c/busses, and move (logically or for
> real) i2c-stub out of it.
> 
> Or are there really other I2C bus drivers which make sense to enable
> under UML?
The only other available in UML which doesn't rely on HAS_IOMEM is the 
PARPORT_LIGHT which relies on direct io access - so I guess this one doesn't 
make sense either.

I created a patch for your proposed solution, I moved the stub driver to the 
end in order to have only one big if HAS_IOMEM.


Thanks,
Peter

---
From 923bc2feac0a04ee35382e60bb523d08baf92d48 Mon Sep 17 00:00:00 2001
From: Peter Huewe <peterhuewe@gmx.de>
Date: Sun, 9 Sep 2012 14:10:05 +0200
Subject: [PATCH] i2c: Move HAS_IOMEM dependency to i2c/busses to make I2C
 available on UML

This patch removes the global dependency of the I2C subsystem on
HAS_IOMEM and moves the dependency to the i2c/busses submenu, with an
exception for i2c-stub.

The generic I2C part does not need to have HAS_IOMEM set and thus now
becomes available in UML, so the I2C subsystem can now be used, e.g.
by the i2c-stub driver, for development of I2C device drivers.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
---
 drivers/i2c/Kconfig        |    1 -
 drivers/i2c/busses/Kconfig |   28 +++++++++++++++-------------
 2 files changed, 15 insertions(+), 14 deletions(-)

diff --git a/drivers/i2c/Kconfig b/drivers/i2c/Kconfig
index 5a3bb3d..e4e02e2 100644
--- a/drivers/i2c/Kconfig
+++ b/drivers/i2c/Kconfig
@@ -4,7 +4,6 @@
 
 menuconfig I2C
 	tristate "I2C support"
-	depends on HAS_IOMEM
 	select RT_MUTEXES
 	---help---
 	  I2C (pronounce: I-squared-C) is a slow serial bus protocol used in
diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
index b4aaa1b..84954de 100644
--- a/drivers/i2c/busses/Kconfig
+++ b/drivers/i2c/busses/Kconfig
@@ -4,6 +4,7 @@
 
 menu "I2C Hardware Bus support"
 
+if HAS_IOMEM
 comment "PC SMBus host controller drivers"
 	depends on PCI
 
@@ -843,19 +844,6 @@ config I2C_SIBYTE
 	help
 	  Supports the SiByte SOC on-chip I2C interfaces (2 channels).
 
-config I2C_STUB
-	tristate "I2C/SMBus Test Stub"
-	depends on EXPERIMENTAL && m
-	default 'n'
-	help
-	  This module may be useful to developers of SMBus client drivers,
-	  especially for certain kinds of sensor chips.
-
-	  If you do build this module, be sure to read the notes and warnings
-	  in <file:Documentation/i2c/i2c-stub>.
-
-	  If you don't know what to do here, definitely say N.
-
 config SCx200_I2C
 	tristate "NatSemi SCx200 I2C using GPIO pins (DEPRECATED)"
 	depends on SCx200_GPIO
@@ -898,5 +886,19 @@ config SCx200_ACB
 
 	  This support is also available as a module.  If so, the module
 	  will be called scx200_acb.
+endif
+
+config I2C_STUB
+	tristate "I2C/SMBus Test Stub"
+	depends on EXPERIMENTAL && m
+	default 'n'
+	help
+	  This module may be useful to developers of SMBus client drivers,
+	  especially for certain kinds of sensor chips.
+
+	  If you do build this module, be sure to read the notes and warnings
+	  in <file:Documentation/i2c/i2c-stub>.
+
+	  If you don't know what to do here, definitely say N.
 
 endmenu
-- 
1.7.8.6




  reply	other threads:[~2012-09-09 12:15 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-02 20:45 [uml-devel] Emulate I2C subsystem/slaves Peter Hüwe
2012-09-03 12:52 ` Richard Weinberger
2012-09-09  1:08   ` Peter Hüwe
2012-09-09  8:13     ` Geert Uytterhoeven
2012-09-09 10:49       ` Peter Hüwe
2012-09-09 11:28         ` Jean Delvare
2012-09-09 12:15           ` Peter Hüwe [this message]
2012-09-09 12:21             ` Geert Uytterhoeven
2012-09-09 12:23             ` Richard Weinberger
2012-09-09 12:52               ` Peter Hüwe
2012-09-09 12:57                 ` Richard Weinberger
2012-09-09 13:11                   ` Peter Hüwe
2012-09-09 13:27                     ` Richard Weinberger
2012-09-09 14:52                       ` Geert Uytterhoeven
2012-09-09 15:00                         ` Richard Weinberger
2012-09-09 15:48                           ` Jean Delvare
2012-09-09 19:12                           ` Peter Hüwe
2012-09-09 20:08                             ` Richard Weinberger
2012-09-09 13:04                 ` Richard Weinberger
2012-09-09 18:40             ` Jean Delvare
2012-09-09 19:17               ` Peter Hüwe
2012-09-10  7:29                 ` Jean Delvare
2012-09-10 19:21                   ` Peter Hüwe
2012-09-11 15:03                     ` Richard Weinberger

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=201209091415.02460.PeterHuewe@gmx.de \
    --to=peterhuewe@gmx.de \
    --cc=geert@linux-m68k.org \
    --cc=khali@linux-fr.org \
    --cc=richard@nod.at \
    --cc=user-mode-linux-devel@lists.sourceforge.net \
    /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