Julian Calaby <[email protected]> writes:

>>         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.

the A20 manual calls it TP_SENSITIVE_ADJUST
=> changed to tp-sensitive-adjust

see also patch just submitted

>>  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.

after taking a look at the other drivers, i think of_property_read_u32
is easier and the devicetree is supposed to have valid values

>
>>         /*
>> -        * 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.

fixed

> Thanks,

thanks,
jens

-- 
Prisirah - Building digital photo frames for family and friends using
open-source hardware. http://karme.de/prisirah/

-- 
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.

Reply via email to