* Problem with s3c24xx pwm driver
@ 2009-09-23 15:24 Vasily Khoruzhick
2009-09-23 19:03 ` Eric Miao
0 siblings, 1 reply; 9+ messages in thread
From: Vasily Khoruzhick @ 2009-09-23 15:24 UTC (permalink / raw)
To: linux-arm-kernel
Hi,
I'm encountering very strange problem with s3c24xx pwm driver. I'm using it
with pwm-bl driver. When backlight level is 0, pwm-bl calls pwm_config(0,
period); pwm_disable(), otherwise it calls pwm_config(duty, period);
pwm_enable().
Problem is that after pwm was disabled, it can't be enabled with
pwm_config(duty, period); pwm_enable() for some (but not all) _valid_
duty/period combinations.
pwm-bl works fine if pwm_disable() call is commented out.
Does anybody know how to solve this problem? Any suggestions?
Regards
Vasily
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20090923/436b5290/attachment.sig>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Problem with s3c24xx pwm driver
2009-09-23 15:24 Problem with s3c24xx pwm driver Vasily Khoruzhick
@ 2009-09-23 19:03 ` Eric Miao
2009-09-23 19:16 ` Vasily Khoruzhick
2009-09-23 19:23 ` Vasily Khoruzhick
0 siblings, 2 replies; 9+ messages in thread
From: Eric Miao @ 2009-09-23 19:03 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, Sep 23, 2009 at 11:24 PM, Vasily Khoruzhick <anarsoul@gmail.com> wrote:
> Hi,
>
> I'm encountering very strange problem with s3c24xx pwm driver. I'm using it
> with pwm-bl driver. When backlight level is 0, pwm-bl calls pwm_config(0,
> period); pwm_disable(), otherwise it calls pwm_config(duty, period);
> pwm_enable().
>
> Problem is that after pwm was disabled, it can't be enabled with
> pwm_config(duty, period); pwm_enable() for some (but not all) _valid_
> duty/period combinations.
>
> pwm-bl works fine if pwm_disable() call is commented out.
>
> Does anybody know how to solve this problem? Any suggestions?
>
Sounds like there are cases where the pwm_enable() and pwm_disable()
are not paired? You may want to print out the reference count each time
to see if this is true.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Problem with s3c24xx pwm driver
2009-09-23 19:03 ` Eric Miao
@ 2009-09-23 19:16 ` Vasily Khoruzhick
2009-09-23 19:23 ` Vasily Khoruzhick
1 sibling, 0 replies; 9+ messages in thread
From: Vasily Khoruzhick @ 2009-09-23 19:16 UTC (permalink / raw)
To: linux-arm-kernel
? ????????? ?? 23 ???????? 2009 22:03:17 ????? Eric Miao ???????:
> Sounds like there are cases where the pwm_enable() and pwm_disable()
> are not paired? You may want to print out the reference count each time
> to see if this is true.
I'm pretty sure they are paired, it's unlikely that it's pwm-bl bug.
Regards
Vasily
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20090923/7afea097/attachment.sig>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Problem with s3c24xx pwm driver
2009-09-23 19:03 ` Eric Miao
2009-09-23 19:16 ` Vasily Khoruzhick
@ 2009-09-23 19:23 ` Vasily Khoruzhick
2009-09-23 22:25 ` Eric Miao
1 sibling, 1 reply; 9+ messages in thread
From: Vasily Khoruzhick @ 2009-09-23 19:23 UTC (permalink / raw)
To: linux-arm-kernel
? ????????? ?? 23 ???????? 2009 22:03:17 ????? Eric Miao ???????:
> Sounds like there are cases where the pwm_enable() and pwm_disable()
> are not paired? You may want to print out the reference count each time
> to see if this is true.
And, btw, pwm_enable()/pwm_disable for s3c24xx just sets/clears one bit. It
doesn't harm to set same bit twice, does it?
Regards
Vasily
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20090923/1c740fa4/attachment.sig>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Problem with s3c24xx pwm driver
2009-09-23 19:23 ` Vasily Khoruzhick
@ 2009-09-23 22:25 ` Eric Miao
2009-09-24 8:54 ` Vasily Khoruzhick
2009-09-24 14:33 ` Vasily Khoruzhick
0 siblings, 2 replies; 9+ messages in thread
From: Eric Miao @ 2009-09-23 22:25 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Sep 24, 2009 at 3:23 AM, Vasily Khoruzhick <anarsoul@gmail.com> wrote:
> ? ????????? ?? 23 ???????? 2009 22:03:17 ????? Eric Miao ???????:
>> Sounds like there are cases where the pwm_enable() and pwm_disable()
>> are not paired? You may want to print out the reference count each time
>> to see if this is true.
>
> And, btw, pwm_enable()/pwm_disable for s3c24xx just sets/clears one bit. It
> doesn't harm to set same bit twice, does it?
>
No, it doesn't.
So my suggestion at the moment is that you may:
1. try dump the registers after pwm_enable() and see if all are setup
correctly,
2. and make sure those registers are write-able at that time (some
SoC doesn't allow register writing when the controller is disabled).
^ permalink raw reply [flat|nested] 9+ messages in thread
* Problem with s3c24xx pwm driver
2009-09-23 22:25 ` Eric Miao
@ 2009-09-24 8:54 ` Vasily Khoruzhick
2009-09-24 14:33 ` Vasily Khoruzhick
1 sibling, 0 replies; 9+ messages in thread
From: Vasily Khoruzhick @ 2009-09-24 8:54 UTC (permalink / raw)
To: linux-arm-kernel
? ????????? ?? 24 ???????? 2009 01:25:46 ????? Eric Miao ???????:
> No, it doesn't.
>
> So my suggestion at the moment is that you may:
>
> 1. try dump the registers after pwm_enable() and see if all are setup
> correctly,
>
> 2. and make sure those registers are write-able at that time (some
> SoC doesn't allow register writing when the controller is disabled).
>
Here's a trace with my comments, but I can't see anything wrong in this trace:
/* Configuring backlight level */
pwm_config:271: TCMPB, wrote: 0000010a, read: 0000010a <- Configure duty
pwm_config:274: TCNTB, wrote: 0000012a, read: 0000012a <- Configure period
pwm_config:281: TCON, wrote: 0051990f, read: 0051990f <- Set manual update
flag
pwm_config:286: TCON, wrote: 0051990d, read: 0051990d <- Clear manual update
flag
pwm_enable:149: TCON, wrote: 0051990d, read: 0051990d <- Enable called each
time if backlight level != 0
/* Configuring backlight level */
pwm_config:271: TCMPB, wrote: 000000a3, read: 000000a3
pwm_config:274: TCNTB, wrote: 0000012a, read: 0000012a
pwm_config:281: TCON, wrote: 0051990f, read: 0051990f
pwm_config:286: TCON, wrote: 0051990d, read: 0051990d
pwm_enable:149: TCON, wrote: 0051990d, read: 0051990d
/* Configuring backlight level */
pwm_config:271: TCMPB, wrote: 00000112, read: 00000112
pwm_config:274: TCNTB, wrote: 0000012a, read: 0000012a
pwm_config:281: TCON, wrote: 0051990f, read: 0051990f
pwm_config:286: TCON, wrote: 0051990d, read: 0051990d
pwm_enable:149: TCON, wrote: 0051990d, read: 0051990d
/* Works fine until next sequence */
/* Disabling backlight */
pwm_config:271: TCMPB, wrote: 00000129, read: 00000129
pwm_config:274: TCNTB, wrote: 0000012a, read: 0000012a
pwm_config:281: TCON, wrote: 0051990f, read: 0051990f
pwm_config:286: TCON, wrote: 0051990d, read: 0051990d
pwm_disable:170: TCON, wrote: 0051990c, read: 0051990c <- Clear start flag
/* Enabling backlight back, but it doesn't work :( */
pwm_config:271: TCMPB, wrote: 00000124, read: 00000124 <- Configure duty
pwm_config:274: TCNTB, wrote: 0000012a, read: 0000012a <- Configure period
pwm_config:281: TCON, wrote: 0051990e, read: 0051990e <- Set manual update
flag
pwm_config:286: TCON, wrote: 0051990c, read: 0051990c <- Clear manual update
flag
pwm_enable:149: TCON, wrote: 0051990d, read: 0051990d <- Set start flag
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20090924/cd49e4b9/attachment.sig>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Problem with s3c24xx pwm driver
2009-09-23 22:25 ` Eric Miao
2009-09-24 8:54 ` Vasily Khoruzhick
@ 2009-09-24 14:33 ` Vasily Khoruzhick
2009-09-24 20:34 ` Russell King - ARM Linux
1 sibling, 1 reply; 9+ messages in thread
From: Vasily Khoruzhick @ 2009-09-24 14:33 UTC (permalink / raw)
To: linux-arm-kernel
? ????????? ?? 24 ???????? 2009 01:25:46 ?? ????????:
> No, it doesn't.
>
> So my suggestion at the moment is that you may:
>
> 1. try dump the registers after pwm_enable() and see if all are setup
> correctly,
>
> 2. and make sure those registers are write-able at that time (some
> SoC doesn't allow register writing when the controller is disabled).
Ok, I've found source of problem: it seems to be some issue with backlight
LED driver (hardware, not software) with selected PWM clock. It seems that
part of period with "1" is not long enought to charge capacitor, or something
like this. PWM itself works fine.
Sorry for buzz.
Regards
Vasily
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20090924/3da13106/attachment.sig>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Problem with s3c24xx pwm driver
2009-09-24 14:33 ` Vasily Khoruzhick
@ 2009-09-24 20:34 ` Russell King - ARM Linux
2009-09-25 6:07 ` Vasily Khoruzhick
0 siblings, 1 reply; 9+ messages in thread
From: Russell King - ARM Linux @ 2009-09-24 20:34 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Sep 24, 2009 at 05:33:24PM +0300, Vasily Khoruzhick wrote:
> Ok, I've found source of problem: it seems to be some issue with backlight
> LED driver (hardware, not software) with selected PWM clock. It seems that
> part of period with "1" is not long enought to charge capacitor, or something
> like this. PWM itself works fine.
Is it LED or is it CCFL? If it's CCFL, it needs to be 'struck' and then
you can reduce the intensity level - by going to max brightness when you
turn it on and then back the intensity down.
That's fairly normal for CCFL stuff.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Problem with s3c24xx pwm driver
2009-09-24 20:34 ` Russell King - ARM Linux
@ 2009-09-25 6:07 ` Vasily Khoruzhick
0 siblings, 0 replies; 9+ messages in thread
From: Vasily Khoruzhick @ 2009-09-25 6:07 UTC (permalink / raw)
To: linux-arm-kernel
? ????????? ?? 24 ???????? 2009 23:34:37 ????? Russell King - ARM Linux
???????:
> Is it LED or is it CCFL? If it's CCFL, it needs to be 'struck' and then
> you can reduce the intensity level - by going to max brightness when you
> turn it on and then back the intensity down.
>
> That's fairly normal for CCFL stuff.
I'm not sure, and I don't know how to check it without disassembling PDA.
Anyway, thanks for suggestion, let's assume that backlight is CCFL.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20090925/0528c02a/attachment.sig>
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2009-09-25 6:07 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-23 15:24 Problem with s3c24xx pwm driver Vasily Khoruzhick
2009-09-23 19:03 ` Eric Miao
2009-09-23 19:16 ` Vasily Khoruzhick
2009-09-23 19:23 ` Vasily Khoruzhick
2009-09-23 22:25 ` Eric Miao
2009-09-24 8:54 ` Vasily Khoruzhick
2009-09-24 14:33 ` Vasily Khoruzhick
2009-09-24 20:34 ` Russell King - ARM Linux
2009-09-25 6:07 ` Vasily Khoruzhick
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).