Re: [Zaurus-devel] [PATCH 1/3] ISL6271A voltage regulator support.

2010-06-13 Thread Marek Vasut
Dne So 12. Ĩervna 2010 19:21:14 Mark Brown napsal(a):
 On Sat, Jun 12, 2010 at 02:44:37PM +0200, Marek Vasut wrote:
  This device is very simple, it supports only one LDO. This single LDO is
  programmed over I2C to 16 possible voltages.
 
 Google tells me that the device has three regulators on it - two LDOs
 and one DCDC buck convertor:
 
http://www.intersil.com/products/deviceinfo.asp?pn=ISL6271A
 
 While the LDOs look like they have no software control it'd be best to
 provide hookup for them, even if that's just a case of instantiating the
 appropriate fixed voltage regulators.

Is this necessary? I'd only increase the kernel size without any gain ... or am 
I wrong ?
 
  Signed-off-by: Marek Vasut marek.va...@gmail.com
  
  +/* Supported voltage values for regulators */
  +static const u32 core_buck_table[] = {
  +85,  90,  95, 100,
  +   105, 110, 115, 120,
  +   125, 130, 135, 140,
  +   145, 150, 155, 160,
  +};
 
 This looks like it could be replaced with a simple function rather than
 a lookup table which would simplify the code.

Will do.
 
 Also, are you sure this is a buck?  That's a specific technical term
 usually only applied to DCDC regulators - LDOs are a different type of
 regulator

That's what's written in the ISL6271a TRM. On the first page, under the 
Features section.
 
  +static int __devinit isl6271a_probe(struct i2c_client *client,
  +const struct i2c_device_id *id)
  +{
  +   struct regulator_init_data *init_data   = client-dev.platform_data;
  +   struct isl_pmic *pmic;
  +   int err;
  +
  +   if (!i2c_check_functionality(client-adapter,
  I2C_FUNC_SMBUS_BYTE_DATA)) +return -EIO;
  +
  +   if (!init_data)
  +   return -EIO;
 
 It'd be better to print an error message here so users know what's going
 on when the device fails to appear.

Ok.

Thanks!

___
Zaurus-devel mailing list
Zaurus-devel@lists.linuxtogo.org
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/zaurus-devel


[Zaurus-devel] [PATCH 2/2] pxa/spitz: Rework spitz

2010-06-13 Thread Marek Vasut
This huge patch mostly shuffles code. The spitz.c file contained terrible mess
and needed a cleanup, here it is:

1) Made every part modular, components are not built in if not selected.
2) Removed loads of preprocessor goo, mostly #ifdef MACH_AKITA  #endif and
   similar code. The kernel size will grow by a few kb now, but the file is much
   more readable.
3) Reworked SD/CF power setting function and made it reentrant.
4) Add ISL6271A regulator support
5) Correctly register WM8750

Signed-off-by: Marek Vasut marek.va...@gmail.com
---
 arch/arm/mach-pxa/include/mach/spitz.h |2 -
 arch/arm/mach-pxa/spitz.c  |  810 ++-
 2 files changed, 470 insertions(+), 342 deletions(-)

diff --git a/arch/arm/mach-pxa/include/mach/spitz.h 
b/arch/arm/mach-pxa/include/mach/spitz.h
index fa1998c..685749a 100644
--- a/arch/arm/mach-pxa/include/mach/spitz.h
+++ b/arch/arm/mach-pxa/include/mach/spitz.h
@@ -185,7 +185,5 @@
 /*
  * Shared data structures
  */
-extern struct platform_device spitzscoop_device;
-extern struct platform_device spitzscoop2_device;
 extern struct platform_device spitzssp_device;
 extern struct sharpsl_charger_machinfo spitz_pm_machinfo;
diff --git a/arch/arm/mach-pxa/spitz.c b/arch/arm/mach-pxa/spitz.c
index 4d2413e..fa31980 100644
--- a/arch/arm/mach-pxa/spitz.c
+++ b/arch/arm/mach-pxa/spitz.c
@@ -18,14 +18,15 @@
 #include linux/gpio_keys.h
 #include linux/gpio.h
 #include linux/leds.h
-#include linux/mtd/physmap.h
 #include linux/i2c.h
 #include linux/i2c/pca953x.h
 #include linux/spi/spi.h
 #include linux/spi/ads7846.h
 #include linux/spi/corgi_lcd.h
+#include linux/mtd/physmap.h
 #include linux/mtd/sharpsl.h
 #include linux/input/matrix_keypad.h
+#include linux/regulator/machine.h
 
 #include asm/setup.h
 #include asm/mach-types.h
@@ -33,11 +34,9 @@
 #include asm/mach/sharpsl_param.h
 #include asm/hardware/scoop.h
 
-
 #include mach/pxa27x.h
 #include mach/pxa27x-udc.h
 #include mach/reset.h
-#include plat/i2c.h
 #include mach/irda.h
 #include mach/mmc.h
 #include mach/ohci.h
@@ -45,11 +44,16 @@
 #include mach/pxa2xx_spi.h
 #include mach/spitz.h
 
+#include plat/i2c.h
+
 #include generic.h
 #include devices.h
 #include sharpsl.h
 
-static unsigned long spitz_pin_config[] __initdata = {
+/**
+ * Pin configuration
+ 
**/
+static unsigned long sharpslc_pin_config[] __initdata = {
/* Chip Selects */
GPIO78_nCS_2,   /* SCOOP #2 */
GPIO79_nCS_3,   /* NAND */
@@ -124,10 +128,13 @@ static unsigned long spitz_pin_config[] __initdata = {
GPIO1_GPIO | WAKEUP_ON_EDGE_FALL,   /* SPITZ_GPIO_RESET */
 };
 
-/*
- * Spitz SCOOP Device #1
- */
-static struct resource spitz_scoop_resources[] = {
+
+/**
+ * Scoop GPIO expander
+ 
**/
+#if defined(CONFIG_SHARP_SCOOP) || defined(CONFIG_SHARP_SCOOP_MODULE)
+/* SCOOP Device #1 */
+static struct resource sharpslc_scoop_1_resources[] = {
[0] = {
.start  = 0x1080,
.end= 0x10800fff,
@@ -135,7 +142,7 @@ static struct resource spitz_scoop_resources[] = {
},
 };
 
-static struct scoop_config spitz_scoop_setup = {
+static struct scoop_config sharpslc_scoop_1_setup = {
.io_dir = SPITZ_SCP_IO_DIR,
.io_out = SPITZ_SCP_IO_OUT,
.suspend_clr= SPITZ_SCP_SUS_CLR,
@@ -143,20 +150,18 @@ static struct scoop_config spitz_scoop_setup = {
.gpio_base  = SPITZ_SCP_GPIO_BASE,
 };
 
-struct platform_device spitzscoop_device = {
+struct platform_device sharpslc_scoop_1_device = {
.name   = sharp-scoop,
.id = 0,
.dev= {
-   .platform_data  = spitz_scoop_setup,
+   .platform_data  = sharpslc_scoop_1_setup,
},
-   .num_resources  = ARRAY_SIZE(spitz_scoop_resources),
-   .resource   = spitz_scoop_resources,
+   .num_resources  = ARRAY_SIZE(sharpslc_scoop_1_resources),
+   .resource   = sharpslc_scoop_1_resources,
 };
 
-/*
- * Spitz SCOOP Device #2
- */
-static struct resource spitz_scoop2_resources[] = {
+/* SCOOP Device #2 */
+static struct resource sharpslc_scoop_2_resources[] = {
[0] = {
.start  = 0x08800040,
.end= 0x08800fff,
@@ -164,7 +169,7 @@ static struct resource spitz_scoop2_resources[] = {
},
 };
 
-static struct scoop_config spitz_scoop2_setup = {
+static struct scoop_config sharpslc_scoop_2_setup = {
.io_dir = SPITZ_SCP2_IO_DIR,
.io_out = SPITZ_SCP2_IO_OUT,
.suspend_clr= SPITZ_SCP2_SUS_CLR,
@@ -172,82 +177,110 @@ static struct scoop_config spitz_scoop2_setup = {

[Zaurus-devel] [PATCH 1/2] ARM/scoop: Add CPR register bit definitions

2010-06-13 Thread Marek Vasut
Add bit definitions of the CPR register of the SCOOP chip into scoop.h. Also,
cleanup the GPCR definitions to match coding style.

Signed-off-by: Marek Vasut marek.va...@gmail.com
---
 arch/arm/include/asm/hardware/scoop.h |   29 +
 1 files changed, 17 insertions(+), 12 deletions(-)

diff --git a/arch/arm/include/asm/hardware/scoop.h 
b/arch/arm/include/asm/hardware/scoop.h
index 46492a6..ebb3cea 100644
--- a/arch/arm/include/asm/hardware/scoop.h
+++ b/arch/arm/include/asm/hardware/scoop.h
@@ -22,18 +22,23 @@
 #define SCOOP_GPWR 0x24
 #define SCOOP_GPRR 0x28
 
-#define SCOOP_GPCR_PA22( 1  12 )
-#define SCOOP_GPCR_PA21( 1  11 )
-#define SCOOP_GPCR_PA20( 1  10 )
-#define SCOOP_GPCR_PA19( 1  9 )
-#define SCOOP_GPCR_PA18( 1  8 )
-#define SCOOP_GPCR_PA17( 1  7 )
-#define SCOOP_GPCR_PA16( 1  6 )
-#define SCOOP_GPCR_PA15( 1  5 )
-#define SCOOP_GPCR_PA14( 1  4 )
-#define SCOOP_GPCR_PA13( 1  3 )
-#define SCOOP_GPCR_PA12( 1  2 )
-#define SCOOP_GPCR_PA11( 1  1 )
+#define SCOOP_CPR_OUT  (1  7)
+#define SCOOP_CPR_SD_3V(1  2)
+#define SCOOP_CPR_CF_XV(1  1)
+#define SCOOP_CPR_CF_3V(1  0)
+
+#define SCOOP_GPCR_PA22(1  12)
+#define SCOOP_GPCR_PA21(1  11)
+#define SCOOP_GPCR_PA20(1  10)
+#define SCOOP_GPCR_PA19(1  9)
+#define SCOOP_GPCR_PA18(1  8)
+#define SCOOP_GPCR_PA17(1  7)
+#define SCOOP_GPCR_PA16(1  6)
+#define SCOOP_GPCR_PA15(1  5)
+#define SCOOP_GPCR_PA14(1  4)
+#define SCOOP_GPCR_PA13(1  3)
+#define SCOOP_GPCR_PA12(1  2)
+#define SCOOP_GPCR_PA11(1  1)
 
 struct scoop_config {
unsigned short io_out;
-- 
1.7.1


___
Zaurus-devel mailing list
Zaurus-devel@lists.linuxtogo.org
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/zaurus-devel