Re: [PATCH v2 6/8] drivers:input:ads7846(+tsc2046): recognise old binding for coordinate flipping

2015-11-14 Thread Rob Herring
On Fri, Nov 13, 2015 at 2:35 PM, H. Nikolaus Schaller  
wrote:
> By this patch we still recognise the old binding ti,swap-xy in parallel to
> the common binding touchscreen-swapped-x-y. This keeps compatibility
> to older (out-of-tree) device tree binaries.
>
> We do this in a separate patch so that it can be easily reverted in the
> future to retire the old API. A notice is printed to remind developers
> of using old API.
>
> We also fix the bindings name for all in-tree device tree sources in
> a separate patch.

This one and patch 5 should be combined, so the series is bisectable.

Rob

>
> Signed-off-by: H. Nikolaus Schaller 
> ---
>  drivers/input/touchscreen/ads7846.c | 6 +-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/input/touchscreen/ads7846.c 
> b/drivers/input/touchscreen/ads7846.c
> index 4525f00..b9896fd 100644
> --- a/drivers/input/touchscreen/ads7846.c
> +++ b/drivers/input/touchscreen/ads7846.c
> @@ -1259,7 +1259,11 @@ static const struct ads7846_platform_data 
> *ads7846_probe_dt(struct device *dev)
> of_property_read_u16(node, "ti,vref-mv", >vref_mv);
> pdata->keep_vref_on = of_property_read_bool(node, "ti,keep-vref-on");
>
> -   pdata->swap_xy = of_property_read_bool(node, 
> "touchscreen-swapped-x-y");
> +   pdata->swap_xy = of_property_read_bool(node, "ti,swap-xy");
> +   if (pdata->swap_xy)
> +   dev_notice(dev, "please update device tree to use 
> touchscreen-swapped-x-y");
> +   pdata->swap_xy |= of_property_read_bool(node,
> +   "touchscreen-swapped-x-y");
>
> of_property_read_u16(node, "ti,settle-delay-usec",
>  >settle_delay_usecs);
> --
> 2.5.1
>
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 1/8] drivers:input:tsc2007: add new common binding names, pre-calibration, flipping and rotation

2015-11-14 Thread Rob Herring
On Fri, Nov 13, 2015 at 09:35:52PM +0100, H. Nikolaus Schaller wrote:
> commit b98abe52fa8e ("Input: add common DT binding for touchscreens")
> introduced common DT bindings for touchscreens [1] and a helper function to
> parse the DT.
> 
> This has been integrated and interpretation of the inversion (flipping)
> properties for the x and y axis has been added to accommodate any
> orientation of the touch in relation to the LCD.
> 
> By scaling the min/max ADC values to the screen size it is now possible to
> pre-calibrate the touch so that is (almost) exactly matches the LCD it is
> glued onto. This allows to well enough operate the touch before a user
> space calibration can improve the precision.
> 
> calculate_pressure has been renamed to calculate_resistance because
> that is what it is doing.
> 
> [1]: Documentation/devicetree/bindings/input/touchscreen/touchscreen.txt

This still looks like it will break with old dtbs. It doesn't matter if 
you update the in tree dts files, you should not force users to update 
their dtb.

Rob

> 
> Signed-off-by: H. Nikolaus Schaller 
> ---
>  .../bindings/input/touchscreen/tsc2007.txt |  20 +--
>  drivers/input/touchscreen/tsc2007.c| 135 
> +
>  include/linux/i2c/tsc2007.h|   8 ++
>  3 files changed, 135 insertions(+), 28 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/input/touchscreen/tsc2007.txt 
> b/Documentation/devicetree/bindings/input/touchscreen/tsc2007.txt
> index ec365e1..6e9fd55 100644
> --- a/Documentation/devicetree/bindings/input/touchscreen/tsc2007.txt
> +++ b/Documentation/devicetree/bindings/input/touchscreen/tsc2007.txt
> @@ -6,6 +6,7 @@ Required properties:
>  - ti,x-plate-ohms: X-plate resistance in ohms.
>  
>  Optional properties:
> +- generic touch screen properties: see touchscreen binding [2].
>  - gpios: the interrupt gpio the chip is connected to (trough the penirq pin).
>The penirq pin goes to low when the panel is touched.
>(see GPIO binding[1] for more details).
> @@ -13,17 +14,20 @@ Optional properties:
>(see interrupt binding[0]).
>  - interrupts: (gpio) interrupt to which the chip is connected
>(see interrupt binding[0]).
> -- ti,max-rt: maximum pressure.
> -- ti,fuzzx: specifies the absolute input fuzz x value.
> -  If set, it will permit noise in the data up to +- the value given to the 
> fuzz
> -  parameter, that is used to filter noise from the event stream.
> -- ti,fuzzy: specifies the absolute input fuzz y value.
> -- ti,fuzzz: specifies the absolute input fuzz z value.
> +- ti,max-rt: maximum pressure resistance above which samples are ignored
> +  (default: 4095).
> +- ti,report-resistance: report resistance (no pressure = max_rt) instead
> +  of pressure (no pressure = 0).
> +- ti,min-x: minimum value reported by X axis ADC (default 0).
> +- ti,max-x: maximum value reported by X axis ADC (default 4095).
> +- ti,min-y: minimum value reported by Y axis ADC (default 0).
> +- ti,max-y: maximum value reported by Y axis ADC (default 4095).
>  - ti,poll-period: how much time to wait (in milliseconds) before reading 
> again the
> -  values from the tsc2007.
> +  values from the tsc2007 (default 1).
>  
>  [0]: Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
>  [1]: Documentation/devicetree/bindings/gpio/gpio.txt
> +[2]: Documentation/devicetree/bindings/input/touchscreen/touchscreen.txt
>  
>  Example:
>{
> @@ -35,6 +39,8 @@ Example:
>   interrupts = <0x0 0x8>;
>   gpios = < 0 0>;
>   ti,x-plate-ohms = <180>;
> + touchscreen-size-x = <640>;
> + touchscreen-size-y = <480>;
>   };
>  
>   /* ... */
> diff --git a/drivers/input/touchscreen/tsc2007.c 
> b/drivers/input/touchscreen/tsc2007.c
> index 5d0cd51..e0c7173 100644
> --- a/drivers/input/touchscreen/tsc2007.c
> +++ b/drivers/input/touchscreen/tsc2007.c
> @@ -29,6 +29,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  
>  #define TSC2007_MEASURE_TEMP0(0x0 << 4)
>  #define TSC2007_MEASURE_AUX  (0x2 << 4)
> @@ -74,6 +75,14 @@ struct tsc2007 {
>  
>   u16 model;
>   u16 x_plate_ohms;
> + boolswap_xy;
> + boolinvert_x;
> + boolinvert_y;
> + boolreport_resistance;
> + u16 min_x;
> + u16 min_y;
> + u16 max_x;
> + u16 max_y;
>   u16 max_rt;
>   unsigned long   poll_period; /* in jiffies */
>   int fuzzx;
> @@ -128,7 +137,8 @@ static void tsc2007_read_values(struct tsc2007 *tsc, 
> struct ts_event *tc)
>   tsc2007_xfer(tsc, PWRDOWN);
>  }
>  
> -static u32 

Re: [Gta04-owner] [PATCH 10/13] twl4030_charger: add software controlled linear charging mode.

2015-11-14 Thread Pavel Machek
Hi!

> > > Pavel Machek  writes:
> > > > On Thu 2015-07-30 10:11:24, NeilBrown wrote:
> > > >> 
> > > >> Add a 'continuous' option for usb charging which enables
> > > >> the "linear" charging mode of the twl4030.
> > > >> 
> > > >> Linear charging does a good job with not-so-reliable power sources.
> > > >> Auto mode does not work well as it switches off when voltage drops
> > > >> momentarily.  Care must be taken not to over-charge.
> > > >
> > > > Can you explain how the user can "care not to over-charge"?
> > > 
> > > The following text reads:
> > > 
> > > It was used with a bike hub dynamo since a year or so. In that case
> > > there are automatically charging stops when the cyclist needs a break.
> > > 
> > > so: take a break from cycling occasionally.
> > 
> > If the charger does not exceed 4.2V, I'd not call it overcharge. (Yes, some 
> > clever
> > chargers actually let the battery drop below 4.2V when charge is done, 
> > but...)
> > 
> Yes, that is the case. Perhaps it is not to be called overcharge but
> it is said that lithium battery charging has to stop if in CV mode the
> current drops too low.  In automatic mode the charger does exactly
> that.
> I would not let a battery for days at 4.2V CV.mode although a lot
> of cheap chargers

Well, I agree that keeping battery at 4.2V constant voltage mode is
bad, but I'd not call it overcharge. If someone can fix the comment,
that would be nice.

> > If the charger _does_ exceed 4.2V, then the battery will explode. Don't do 
> > that. Don't
> > offer that to the user.
> > 
> > On a related note... I've just killed USB charger by overloading it. They 
> > are not protected.
> > 
> > I believe your automatically-pull-max-power really should stick to the 
> > well-known charging
> > currents (.5A, 1A, 1.7A), at the very minimum.
> > 
> The main reason for the patch was to prevent switching off charging
> when Vbus drops low. The reason was not to get out extremely much
> current out of the charger.
> The electrical characteristics of a  bicycle as a power source are.
> - the amount of current available changes
>- 500mA at around 17km/h
> - you cannot destroy it by electrically overloading
> 
> If the current is set to e.g. 500mA and that linear charging mode is
> enabled, the battery gets the maximum current available (upto
> 500mA) regardless of the speed which is often changing.

Yes... I guess that makes sense for you, but I wonder if we should be
doing this by default. It seems a lot of cheap chargers can be easily
destroyed if you overload them.

Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) 
http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html