From: Noralf Tronnes <notro-L59+Z2yzLopAfugRpC6u6w@public.gmane.org>
To: Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>
Cc: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: Initial register settings in Device Tree?
Date: Fri, 27 Jun 2014 15:50:51 +0200 [thread overview]
Message-ID: <53AD76BB.5040802@tronnes.org> (raw)
In-Reply-To: <4617934.0IxWlTMVfd@wuerfel>
Den 25.06.2014 12:06, skrev Arnd Bergmann:
> On Tuesday 24 June 2014 18:52:52 Noralf Tronnes wrote:
>> Den 23.06.2014 15:38, skrev Arnd Bergmann:
>>> On Sunday 22 June 2014 21:27:52 Noralf Trønnes wrote:
>>>> Den 22.06.2014 20:18, skrev Arnd Bergmann:
>>>>> On Sunday 22 June 2014 19:37:56 Noralf Trønnes wrote:
>>>> Or should each register have it's own property?
>>>> st7735r,pwctr1 = <C5 C2 0A 00>
>>> Each user-serviceable property should be abstract and use the normal
>>> units that you'd expect to see in a data sheet: milivolts, nanoseconds,
>>> etc. See if some other display controller already has picked names
>>> for these properties, then use the same. If nobody has done this
>>> before, try to use property names that would also make sense on a
>>> different controller. If we get a couple of these, we can split out
>>> the property parsing code into a separate helper module.
>> I found this example that uses regulators to specify voltage:
>> Documentation/devicetree/bindings/gpu/nvidia,tegra20-host1x.txt
>> - dsi: display serial interface
>> - avdd-dsi-supply: phandle of a supply that powers the DSI controller
>>
>> If I should use regulators, I would need to have a controller driver and
>> a panel driver, so to avoid that I just specify the millivolt/factor
>> directly.
>> This way the DT controller node will contain the panel description.
>> (I could add a generic panel driver if regulators is the way to go)
>>
>> This is how the setup could be for a ST7735R controller:
>>
>> st7735r,avdd-millivolt = <4900> /* 4.9v */
>> st7735r,vrhp-millivolt = <4600> /* 4.6v */
>> st7735r,vrhn-millivolt = <4600> /* -4.6 */
>> st7735r,pwr-mode = <2> /* 0=2x, 1=3x, 2=auto (the datasheet doesn't say
>> what this is) */
>> st7735r,vgh25-millivolt = <2400>
>> st7735r,vgh-factor = <1> /* 0=2*AVDD+VGH25, 1=3*AVDD, 2=3*AVDD+VGH25 */
>> st7735r,vgl-millivolt = <10000> /* -10v */
>> /* ap,sap,pwr-freqX have to do with power consumption vs. image quality. */
>> st7735r,ap-factor = <1> /* Current in source driver op-amp: 0=small,
>> 1=medium low, 2=medium, 3=medium high, 4=large */
>> st7735r,sap-factor = <0> /* Current in source driver op-amp: 0=small,
>> 1=medium low, 2=medium, 3=medium high, 4=large */
>> /* Booster circuit Step-up cycle in Normal mode/ full colors */
>> st7735r,pwr-freq1-factor-normal = <1> /* BCLK/{1, 1.5, 2, 4} */
>> st7735r,pwr-freq2-factor-normal = <1>
>> st7735r,pwr-freq3-factor-normal = <1>
>> st7735r,pwr-freq4-factor-normal = <1>
>> st7735r,vcom-millivolt = <775> /* -0.775v */
>> st7735r,rotation = <0> /* Display rotation: 0,90,180,270 */
>> st7735r,gamma-positive = <0f 1a 0f 18 2f 28 20 22 1f 1b 23 37 00 07 02 10>
>> st7735r,gamma-negative = <0f 1b 0f 17 33 2c 29 2e 30 30 39 3f 00 07 03 10>
>>
>>
>> For a ILI9325 controller:
>>
>> ili9325,gamma-ap-factor = <100> /* Gamma driver amplifiers constant
>> current ratio: 0=1.00, 1=0.75, 2=0.50 */
>> ili9325,source-ap-factor = <75> /* Source driver amplifiers constant
>> current ratio: 0=1.00, 1=0.75, 2=0.50 */
>> ili9325,vgh-factor = <4> /* Vci1 x {4,5,6} */
>> ili9325,vgl-factor = <3> /* -Vci x {3,4,5} */
>> ili9325,vci1-factor = <100> /* Vci x {1.00 - 0.70} */
>> ili9325,pwr-freq1-factor = <1> /* Fosc / {1, 2, 4, 8, 16, 32, 64} */
>> ili9325,pwr-freq2-factor = <4> /* Fosc / {4, 8, 16, 32, 64, 128, 256} */
>> ili9325,vci-internal /* use internal 2.5V for Vci reference, default is
>> Vci pin */
>> ili9325,vreg1out-factor = <160> /* Vci x {1.60 - 2.00} */
>> ili9325,vcom-amplitude-factor = <100> /* VREG1OUT x {0.70 - 1.24} */
>> ili9325,vcomh-factor = <> /* VREG1OUT x {0.685 - 1.000} */
>> ili9325,rotation = <0> /* Display rotation: 0,90,180,270 */
>> ili9325,gamma-positive = <10 values>
>> ili9325,gamma-negative = <10 values>
> This doesn't feel right to me at all, though I have a hard time
> coming up with the correct solution since I still don't understand
> enough of the subject matter.
I found this driver that has the same kind of initialization that I need:
Documentation/devicetree/bindings/panel/samsung,ld9040.txt
drivers/gpu/drm/panel/panel-ld9040.c
I guess I'll do something similar.
Thanks for your time Arnd.
Noralf.
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
prev parent reply other threads:[~2014-06-27 13:50 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-22 17:37 Initial register settings in Device Tree? Noralf Trønnes
[not found] ` <53A71474.7030704-L59+Z2yzLopAfugRpC6u6w@public.gmane.org>
2014-06-22 18:18 ` Arnd Bergmann
2014-06-22 19:27 ` Noralf Trønnes
[not found] ` <53A72E38.8040307-L59+Z2yzLopAfugRpC6u6w@public.gmane.org>
2014-06-23 13:38 ` Arnd Bergmann
2014-06-24 16:52 ` Noralf Tronnes
[not found] ` <53A9ACE4.9040506-L59+Z2yzLopAfugRpC6u6w@public.gmane.org>
2014-06-25 10:06 ` Arnd Bergmann
2014-06-27 13:50 ` Noralf Tronnes [this message]
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=53AD76BB.5040802@tronnes.org \
--to=notro-l59+z2yzlopafugrpc6u6w@public.gmane.org \
--cc=arnd-r2nGTMty4D4@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
/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;
as well as URLs for NNTP newsgroup(s).