Hi Jens, On Thu, Mar 12, 2015 at 12:49 AM, Jens Thiele <[email protected]> wrote: > Julian Calaby <[email protected]> writes: > >> Hi Jens, > > Hi, > > [...] > >> IMHO we should have access to all the parameters that can be >> configured per-device in the DTS. That we don't is a bug that arguably >> should be fixed. Again, I urge you to make that parameter available in >> device tree as it'll be useful for you in conjunction with device tree >> overlays. > > ok, I thought I will give it a try and that it should be trivial to at > least add a property for TP_SENSITIVE_ADJUST in a few minutes. But it > looks like the details need some more knowledge/thinking (I am a kernel > and device tree noob). My current diff is attached (inline), any review > / comments are very welcome (especially the "todo:" points).
I'm a noob when it comes to device tree too, however apart from a couple of points which I'll detail inline below, it looks good to me. I'd recommend you post it as a [RFC] patch. Thanks, Julian Calaby > thanks, > jens > > -- > You received this message because you are subscribed to the Google Groups > "linux-sunxi" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > > Changes at prisirah > Modified > Documentation/devicetree/bindings/input/touchscreen/sun4i.txt > diff --git a/Documentation/devicetree/bindings/input/touchscreen/sun4i.txt > b/Documentation/devicetree/bindings/input/touchscreen/sun4i.txt > index aef5779..b4ea9c4 100644 > --- a/Documentation/devicetree/bindings/input/touchscreen/sun4i.txt > +++ b/Documentation/devicetree/bindings/input/touchscreen/sun4i.txt > @@ -7,9 +7,13 @@ Required properties: > - interrupts: interrupt to which the chip is connected > > Optional properties: > - - allwinner,ts-attached: boolean indicating that an actual touchscreen is > - attached to the controller > - > + - allwinner,ts-attached : boolean indicating that an actual > touchscreen > + is attached to the controller > + - allwinner,ts-sensitive-adjust : integer (4 bits), adjust sensitivity > + between 0 (least sensitive) and 15 > + (defaults to 15) > + todo: added in 4.x? > + is there some "standard" way to track this? It's called "Sensitive level" in the FEX files, so I'd recommend calling it that here to help people when they're converting FEX files, however the code calls it sensitive adjust so both are probably equally good. > Example: > > rtp: rtp@01c25000 { > @@ -17,4 +21,5 @@ Example: > reg = <0x01c25000 0x100>; > interrupts = <29>; > allwinner,ts-attached; > + allwinner,ts-sensitive-adjust = <0>; > }; > Modified drivers/input/touchscreen/sun4i-ts.c > diff --git a/drivers/input/touchscreen/sun4i-ts.c > b/drivers/input/touchscreen/sun4i-ts.c > index e692f8e..9ffff73 100644 > --- a/drivers/input/touchscreen/sun4i-ts.c > +++ b/drivers/input/touchscreen/sun4i-ts.c > @@ -216,6 +216,7 @@ static int sun4i_ts_probe(struct platform_device *pdev) > struct device *hwmon; > int error; > bool ts_attached; > + u32 ts_sensitive_adjust = 15; /* use old fixed value as default */ > > ts = devm_kzalloc(dev, sizeof(struct sun4i_ts_data), GFP_KERNEL); > if (!ts) > @@ -263,11 +264,19 @@ static int sun4i_ts_probe(struct platform_device *pdev) > writel(ADC_CLK_SEL(0) | ADC_CLK_DIV(2) | FS_DIV(7) | T_ACQ(63), > ts->base + TP_CTRL0); > > + /* optional property > + todo: > + - use of_property_read_u8 ? > + - check range / 4bits, 0 - 15 ? > + "device tree schemas and validation" > + http://lwn.net/Articles/568217/ > + or clamp? or ... */ > + of_property_read_u32(np, "allwinner,ts-sensitive-adjust", > &ts_sensitive_adjust); > + Personally, if there's a u8 version of of_property_read() I'd use that (and make the variable above a u8 also). Either way there needs to be some level of validation and clamping before it gets passed into writel() below. > /* > - * sensitive_adjust = 15 : max, which is not all that sensitive, > * tp_mode = 0 : only x and y coordinates, as we don't use dual touch > */ > - writel(TP_SENSITIVE_ADJUST(0) | TP_MODE_SELECT(0), > + writel(TP_SENSITIVE_ADJUST(ts_sensitive_adjust) | TP_MODE_SELECT(0), I'm guessing this is on top of your original patch? You should make your patches on top of upstream. Thanks, -- Julian Calaby Email: [email protected] Profile: http://www.google.com/profiles/julian.calaby/ -- You received this message because you are subscribed to the Google Groups "linux-sunxi" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
