[PATCH] Fix for missing possibility to power on GSM in om-gta02-2.6.34

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH] Fix for missing possibility to power on GSM in om-gta02-2.6.34

Gennady Kupava
In om-gta02-2.6.34, i had problem with impossibility to power on gsm.
Problem were that no sysfs node exited.

Kernel logs (with debugging) for working .32:
www.bsdmn.com/openmoko/gsm/32.log

Kernel logs (with debugging) for .34 without fix:
www.bsdmn.com/openmoko/gsm/34unfixed.log

Kernel logs (with debugging) for .34 with fix:
www.bsdmn.com/openmoko/gsm/34fixed.log

to power on gsm use:
echo 1
> /sys/bus/platform/devices/reg-fixed-voltage.1/gta02-pm-gsm.0/power_on

Problem were introduced by diff:
in .34:
pcf50633-gpio     264 drivers/mfd/pcf50633-core.c
PCF50633_CELL("pcf50633-gpio"),
in .32:
pcf50633-gpio     624 drivers/mfd/pcf50633-core.c
pcf50633_client_dev_register(pcf, "pcf50633-gpio",

Patch renames board-specific platform bus device pattern to match new
device name.

Patch:
diff --git a/arch/arm/mach-s3c2440/mach-gta02.c
b/arch/arm/mach-s3c2440/mach-gta02.c
index b23b011..bad9b08 100644
--- a/arch/arm/mach-s3c2440/mach-gta02.c
+++ b/arch/arm/mach-s3c2440/mach-gta02.c
@@ -1153,7 +1153,7 @@ static struct platform_device*
gta02_hdq_children[] = {

 static struct gta02_device_children gta02_device_children[] = {
        {
-               .dev_name = "pcf50633-gpio",
+               .dev_name = "pcf50633-gpio.0",
                .num_children = 1,
                .children = gta02_pcf50633_gpio_children,
        },


and copy in attachment.

Gennady.

gsm_power_fix_34.patch (497 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Fix for missing possibility to power on GSM in om-gta02-2.6.34

Timo Juhani Lindfors
Hi,

Gennady Kupava <[hidden email]> writes:
> to power on gsm use:
> echo 1
>> /sys/bus/platform/devices/reg-fixed-voltage.1/gta02-pm-gsm.0/power_on

should I add this to omhacks?

It now supports

/sys/class/i2c-adapter/i2c-0/0-0073/neo1973-pm-gsm.0

and

/sys/class/i2c-adapter/i2c-0/0-0073/gta02-pm-gsm.0

-Timo

Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Fix for missing possibility to power on GSM in om-gta02-2.6.34

Lars-Peter Clausen
Timo Juhani Lindfors wrote:

> Hi,
>
> Gennady Kupava <[hidden email]> writes:
>> to power on gsm use:
>> echo 1
>>> /sys/bus/platform/devices/reg-fixed-voltage.1/gta02-pm-gsm.0/power_on
>
> should I add this to omhacks?
>
> It now supports
>
> /sys/class/i2c-adapter/i2c-0/0-0073/neo1973-pm-gsm.0
>
> and
>
> /sys/class/i2c-adapter/i2c-0/0-0073/gta02-pm-gsm.0
>
> -Timo
>

Hi

/sys/bus/platform/devices/gta02-pm-gsm.0 is what you should use

- Lars

Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Fix for missing possibility to power on GSM in om-gta02-2.6.34

Timo Juhani Lindfors
Hi,

Lars-Peter Clausen <[hidden email]> writes:
> /sys/bus/platform/devices/gta02-pm-gsm.0 is what you should use

aha, thank you. I'll replace

/sys/devices/platform/s3c2440-i2c/i2c-0/0-0073/pcf50633-gpio/reg-fixed-voltage.1/gta02-pm-gsm.0

with

/sys/bus/platform/devices/gta02-pm-gsm.0

so that now omhacks tries the following three paths and uses the first
one that exists:

/sys/class/i2c-adapter/i2c-0/0-0073/neo1973-pm-gsm.0
/sys/class/i2c-adapter/i2c-0/0-0073/gta02-pm-gsm.0
/sys/bus/platform/devices/gta02-pm-gsm.0

-Timo

Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Fix for missing possibility to power on GSM in om-gta02-2.6.34

Lars-Peter Clausen
Timo Juhani Lindfors wrote:

> Hi,
>
> Lars-Peter Clausen <[hidden email]> writes:
>> /sys/bus/platform/devices/gta02-pm-gsm.0 is what you should use
>
> aha, thank you. I'll replace
>
> /sys/devices/platform/s3c2440-i2c/i2c-0/0-0073/pcf50633-gpio/reg-fixed-voltage.1/gta02-pm-gsm.0
>
> with
>
> /sys/bus/platform/devices/gta02-pm-gsm.0
>
> so that now omhacks tries the following three paths and uses the first
> one that exists:
>
> /sys/class/i2c-adapter/i2c-0/0-0073/neo1973-pm-gsm.0
> /sys/class/i2c-adapter/i2c-0/0-0073/gta02-pm-gsm.0
> /sys/bus/platform/devices/gta02-pm-gsm.0
>
> -Timo

Hi

I think using
/sys/bus/platform/devices/neo1973-pm-gsm.0
and
/sys/bus/platform/devices/gta02-pm-gsm.0
would be the best.
All other paths with the same basename should only be symlinks to one of these two.

- Lars

Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Fix for missing possibility to power on GSM in om-gta02-2.6.34

Timo Juhani Lindfors
Hi,

Lars-Peter Clausen <[hidden email]> writes:
> I think using
> /sys/bus/platform/devices/neo1973-pm-gsm.0
> and
> /sys/bus/platform/devices/gta02-pm-gsm.0
> would be the best.
> All other paths with the same basename should only be symlinks to one of these two.

Thanks. However, since I can't easily test the older kernel versions I
don't feel confident in changing the old legacy paths. However, I'm
sure we can make the paths that are currently in use more sane. Here's
a list of /sys paths used by omhacks grouped by the command(s) that
access them. It tries these in order and picks the first one that is
found.

om battery
==========

/sys/class/power_supply/battery
/sys/class/power_supply/bat

om backlight
============

/sys/class/backlight/gta02-bl/brightness
/sys/devices/virtual/backlight/acpi_video0/brightness
/sys/devices/platform/s3c2440-i2c/i2c-0/0-0073/pcf50633-backlight.0/backlight/pcf50633-backlight/brightness
/sys/devices/platform/s3c2440-i2c/i2c-0/0-0073/pcf50633-backlight/backlight/pcf50633-backlight/brightness

om battery charger-limit [0-500]
================================

/sys/class/i2c-adapter/i2c-0/0-0073/pcf50633-mbc/chg_curlim
/sys/devices/platform/s3c2440-i2c/i2c-0/0-0073/pcf50633-mbc/chg_curlim

om resume-reason
================

/sys/class/i2c-adapter/i2c-0/0-0073/neo1973-resume.0/resume_reason
/sys/class/i2c-adapter/i2c-0/0-0073/resume_reason

om bt power
===========

/sys/class/i2c-adapter/i2c-0/0-0073/pcf50633-regltr.6/neo1973-pm-bt.0
/sys/devices/platform/gta02-pm-bt.0

om gps power
============

/sys/class/i2c-adapter/i2c-0/0-0073/pcf50633-regltr.7/neo1973-pm-gps.0
/sys/class/i2c-adapter/i2c-0/0-0073/pcf50633-regltr.7/gta02-pm-gps.0
/sys/devices/platform/gta02-pm-gps.0

(and /keep_on_in_suspend here for om gps [--swap] keep-on-in-suspend [1/0])

om gsm power
============

/sys/class/i2c-adapter/i2c-0/0-0073/neo1973-pm-gsm.0
/sys/class/i2c-adapter/i2c-0/0-0073/gta02-pm-gsm.0
/sys/bus/platform/devices/gta02-pm-gsm.0

om usb mode [device|host]
=========================

/sys/devices/platform/s3c-ohci/usb_mode

om usb charger-mode [charge-battery|power-usb]
==============================================

/sys/class/i2c-adapter/i2c-0/0-0073/neo1973-pm-host.0/hostmode

om usb charger-limit [0|100|500]
================================

/sys/class/i2c-adapter/i2c-0/0-0073/pcf50633-mbc/usb_curlim

om wifi keep-bus-on-in-suspend [1/0]
====================================

/sys/module/s3cmci/parameters/persist

om wifi power
=============

/sys/bus/platform/drivers/s3c2440-sdi