Re: [PATCH V5 2/4] DRIVERS: IRQCHIP: CROSSBAR: Add support for Crossbar IP

2014-02-03 Thread Sricharan R
Hi Thomas,

On Thursday 16 January 2014 03:52 PM, Sricharan R wrote:
 Hi Thomas,
 
 On Tuesday 03 December 2013 03:57 PM, Sricharan R wrote:
 Some socs have a large number of interrupts requests to service
 the needs of its many peripherals and subsystems. All of the
 interrupt lines from the subsystems are not needed at the same
 time, so they have to be muxed to the irq-controller appropriately.
 In such places a interrupt controllers are preceded by an CROSSBAR
 that provides flexibility in muxing the device requests to the controller
 inputs.

 This driver takes care a allocating a free irq and then configuring the
 crossbar IP as a part of the mpu's irqchip callbacks. crossbar_init should
 be called right before the irqchip_init, so that it is setup to handle the
 irqchip callbacks.

 Cc: Thomas Gleixner t...@linutronix.de
 Cc: Linus Walleij linus.wall...@linaro.org
 Cc: Santosh Shilimkar santosh.shilim...@ti.com
 Cc: Russell King li...@arm.linux.org.uk
 Cc: Tony Lindgren t...@atomide.com
 Cc: Rajendra Nayak rna...@ti.com
 Cc: Marc Zyngier marc.zyng...@arm.com
 Cc: Grant Likely grant.lik...@linaro.org
 Cc: Rob Herring rob.herr...@calxeda.com
 Signed-off-by: Sricharan R r.sricha...@ti.com
 Acked-by: Kumar Gala ga...@codeaurora.org (for DT binding portion)
 Acked-by: Santosh Shilimkar santosh.shilim...@ti.com
 Acked-by: Linus Walleij linus.wall...@linaro.org
 ---
  [v5] Used the function of_property_read_u32_index instead of raw reading
   from DT as per comments from Mark Rutland mark.rutl...@arm.com

  .../devicetree/bindings/arm/omap/crossbar.txt  |   27 +++
  drivers/irqchip/Kconfig|8 +
  drivers/irqchip/Makefile   |1 +
  drivers/irqchip/irq-crossbar.c |  208 
 
  include/linux/irqchip/irq-crossbar.h   |   11 ++
  5 files changed, 255 insertions(+)
  create mode 100644 Documentation/devicetree/bindings/arm/omap/crossbar.txt
  create mode 100644 drivers/irqchip/irq-crossbar.c
  create mode 100644 include/linux/irqchip/irq-crossbar.h

 diff --git a/Documentation/devicetree/bindings/arm/omap/crossbar.txt 
 b/Documentation/devicetree/bindings/arm/omap/crossbar.txt
 new file mode 100644
 index 000..fb88585
 --- /dev/null
 +++ b/Documentation/devicetree/bindings/arm/omap/crossbar.txt
 @@ -0,0 +1,27 @@
 +Some socs have a large number of interrupts requests to service
 +the needs of its many peripherals and subsystems. All of the
 +interrupt lines from the subsystems are not needed at the same
 +time, so they have to be muxed to the irq-controller appropriately.
 +In such places a interrupt controllers are preceded by an CROSSBAR
 +that provides flexibility in muxing the device requests to the controller
 +inputs.
 +
 +Required properties:
 +- compatible : Should be ti,irq-crossbar
 +- reg: Base address and the size of the crossbar registers.
 +- ti,max-irqs: Total number of irqs available at the interrupt controller.
 +- ti,reg-size: Size of a individual register in bytes. Every individual
 +register is assumed to be of same size. Valid sizes are 1, 2, 4.
 +- ti,irqs-reserved: List of the reserved irq lines that are not muxed using
 + crossbar. These interrupt lines are reserved in the soc,
 + so crossbar bar driver should not consider them as free
 + lines.
 +
 +Examples:
 +crossbar_mpu: @4a02 {
 +compatible = ti,irq-crossbar;
 +reg = 0x4a002a48 0x130;
 +ti,max-irqs = 160;
 +ti,reg-size = 2;
 +ti,irqs-reserved = 0 1 2 3 5 6 131 132 139 140;
 +};
 diff --git a/drivers/irqchip/Kconfig b/drivers/irqchip/Kconfig
 index 3792a1a..2efcde6 100644
 --- a/drivers/irqchip/Kconfig
 +++ b/drivers/irqchip/Kconfig
 @@ -61,3 +61,11 @@ config VERSATILE_FPGA_IRQ_NR
 int
 default 4
 depends on VERSATILE_FPGA_IRQ
 +
 +config IRQ_CROSSBAR
 +bool
 +help
 +  Support for a CROSSBAR ip that preceeds the main interrupt controller.
 +  The primary irqchip invokes the crossbar's callback which inturn 
 allocates
 +  a free irq and configures the IP. Thus the peripheral interrupts are
 +  routed to one of the free irqchip interrupt lines.
 diff --git a/drivers/irqchip/Makefile b/drivers/irqchip/Makefile
 index c60b901..2edead9 100644
 --- a/drivers/irqchip/Makefile
 +++ b/drivers/irqchip/Makefile
 @@ -22,3 +22,4 @@ obj-$(CONFIG_RENESAS_IRQC) += irq-renesas-irqc.o
  obj-$(CONFIG_VERSATILE_FPGA_IRQ)+= irq-versatile-fpga.o
  obj-$(CONFIG_ARCH_VT8500)   += irq-vt8500.o
  obj-$(CONFIG_TB10X_IRQC)+= irq-tb10x.o
 +obj-$(CONFIG_IRQ_CROSSBAR)  += irq-crossbar.o
 diff --git a/drivers/irqchip/irq-crossbar.c b/drivers/irqchip/irq-crossbar.c
 new file mode 100644
 index 000..ae605a3
 --- /dev/null
 +++ b/drivers/irqchip/irq-crossbar.c
 @@ -0,0 +1,208 @@
 +/*
 + *  

[PATCH v2 0/6] IIO pulse capture support for TI ECAP

2014-02-03 Thread Matt Porter
Changes since v1:
- Rebased to 3.14-rc1
- Renamed in_pulse_polarity to pulse_polarity
- Added ABI entries for pulse devices and TI ECAP

This series adds support for PWM capture devices within IIO and
adds a TI ECAP IIO driver.

PWM capture devices are supported using a new IIO pulse channel type.

The IIO ECAP driver implements interrupt driven triggered buffer capture
only as raw sample reads are not applicable to this hardware.
Initially, the driver supports a single pulse width measurement with
configurable polarity. The ECAP hardware can support measurement of a
complete period and duty cycle but this is not yet implemented.

Matt Porter (6):
  iio: add support for pulse width capture devices
  iio: pulse: add TI ECAP driver
  iio: enable selection and build of pulse drivers
  iio: Add ABI docs for pulse capture devices
  pwm: enable TI PWMSS if the IIO tiecap driver is selected
  ARM: dts: AM33XX: Add ecap interrupt properties

 Documentation/ABI/testing/sysfs-bus-iio|  18 +
 .../ABI/testing/sysfs-bus-iio-pulse-tiecap |   9 +
 arch/arm/boot/dts/am33xx.dtsi  |   6 +
 drivers/iio/Kconfig|   1 +
 drivers/iio/Makefile   |   1 +
 drivers/iio/industrialio-core.c|   1 +
 drivers/iio/pulse/Kconfig  |  20 +
 drivers/iio/pulse/Makefile |   6 +
 drivers/iio/pulse/tiecap.c | 493 +
 drivers/pwm/Kconfig|   2 +-
 include/linux/iio/types.h  |   1 +
 11 files changed, 557 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/ABI/testing/sysfs-bus-iio-pulse-tiecap
 create mode 100644 drivers/iio/pulse/Kconfig
 create mode 100644 drivers/iio/pulse/Makefile
 create mode 100644 drivers/iio/pulse/tiecap.c

-- 
1.8.4

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


[PATCH v2 6/6] ARM: dts: AM33XX: Add ecap interrupt properties

2014-02-03 Thread Matt Porter
Add missing interrupt properties to the ecap0, ecap1, and ecap2
nodes.

Signed-off-by: Matt Porter mpor...@linaro.org
---
 arch/arm/boot/dts/am33xx.dtsi | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/arch/arm/boot/dts/am33xx.dtsi b/arch/arm/boot/dts/am33xx.dtsi
index 6d95d3d..b4139ba 100644
--- a/arch/arm/boot/dts/am33xx.dtsi
+++ b/arch/arm/boot/dts/am33xx.dtsi
@@ -582,6 +582,8 @@
compatible = ti,am33xx-ecap;
#pwm-cells = 3;
reg = 0x48300100 0x80;
+   interrupts = 31;
+   interrupt-names = ecap0;
ti,hwmods = ecap0;
status = disabled;
};
@@ -610,6 +612,8 @@
compatible = ti,am33xx-ecap;
#pwm-cells = 3;
reg = 0x48302100 0x80;
+   interrupts = 47;
+   interrupt-names = ecap1;
ti,hwmods = ecap1;
status = disabled;
};
@@ -638,6 +642,8 @@
compatible = ti,am33xx-ecap;
#pwm-cells = 3;
reg = 0x48304100 0x80;
+   interrupts = 61;
+   interrupt-names = ecap2;
ti,hwmods = ecap2;
status = disabled;
};
-- 
1.8.4

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


[PATCH v2 5/6] pwm: enable TI PWMSS if the IIO tiecap driver is selected

2014-02-03 Thread Matt Porter
The IIO TI ECAP driver depends on the TI PWMSS management
driver in this subsystem. Enable PWMSS when the IIO TI ECAP
driver is selected.

Signed-off-by: Matt Porter mpor...@linaro.org
---
 drivers/pwm/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pwm/Kconfig b/drivers/pwm/Kconfig
index 22f2f28..bd3cc65 100644
--- a/drivers/pwm/Kconfig
+++ b/drivers/pwm/Kconfig
@@ -219,7 +219,7 @@ config  PWM_TIEHRPWM
 
 config  PWM_TIPWMSS
bool
-   default y if SOC_AM33XX  (PWM_TIECAP || PWM_TIEHRPWM)
+   default y if SOC_AM33XX  (IIO_TIECAP || PWM_TIECAP || PWM_TIEHRPWM)
help
  PWM Subsystem driver support for AM33xx SOC.
 
-- 
1.8.4

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


[PATCH v2 4/6] iio: Add ABI docs for pulse capture devices

2014-02-03 Thread Matt Porter
Add standard ABI entries for pulse capture devices. Also add
a separate ABI entry for the TI ECAP driver polarity option.

Signed-off-by: Matt Porter mpor...@linaro.org
---
 Documentation/ABI/testing/sysfs-bus-iio  | 18 ++
 Documentation/ABI/testing/sysfs-bus-iio-pulse-tiecap |  9 +
 2 files changed, 27 insertions(+)
 create mode 100644 Documentation/ABI/testing/sysfs-bus-iio-pulse-tiecap

diff --git a/Documentation/ABI/testing/sysfs-bus-iio 
b/Documentation/ABI/testing/sysfs-bus-iio
index 6e02c50..918a201 100644
--- a/Documentation/ABI/testing/sysfs-bus-iio
+++ b/Documentation/ABI/testing/sysfs-bus-iio
@@ -210,6 +210,14 @@ Contact:   linux-...@vger.kernel.org
 Description:
Scaled humidity measurement in milli percent.
 
+What:  /sys/bus/iio/devices/iio:deviceX/in_pulseY_raw
+What:  /sys/bus/iio/devices/iio:deviceX/in_pulse_raw
+KernelVersion: 3.15
+Contact:   linux-...@vger.kernel.org
+Description:
+   Raw pulse measurement from channel Y. Units after
+   application of scale and offset are nanoseconds.
+
 What:  /sys/bus/iio/devices/iio:deviceX/in_accel_offset
 What:  /sys/bus/iio/devices/iio:deviceX/in_accel_x_offset
 What:  /sys/bus/iio/devices/iio:deviceX/in_accel_y_offset
@@ -220,6 +228,8 @@ What:   
/sys/bus/iio/devices/iio:deviceX/in_tempY_offset
 What:  /sys/bus/iio/devices/iio:deviceX/in_temp_offset
 What:  /sys/bus/iio/devices/iio:deviceX/in_pressureY_offset
 What:  /sys/bus/iio/devices/iio:deviceX/in_pressure_offset
+What:  /sys/bus/iio/devices/iio:deviceX/in_pulseY_offset
+What:  /sys/bus/iio/devices/iio:deviceX/in_pulse_offset
 KernelVersion: 2.6.35
 Contact:   linux-...@vger.kernel.org
 Description:
@@ -251,6 +261,8 @@ What:   
/sys/bus/iio/devices/iio:deviceX/in_magn_y_scale
 What:  /sys/bus/iio/devices/iio:deviceX/in_magn_z_scale
 What:  /sys/bus/iio/devices/iio:deviceX/in_pressureY_scale
 What:  /sys/bus/iio/devices/iio:deviceX/in_pressure_scale
+What:  /sys/bus/iio/devices/iio:deviceX/in_pulseY_scale
+What:  /sys/bus/iio/devices/iio:deviceX/in_pulse_scale
 KernelVersion: 2.6.35
 Contact:   linux-...@vger.kernel.org
 Description:
@@ -784,6 +796,8 @@ What:   
/sys/.../iio:deviceX/scan_elements/in_incli_x_en
 What:  /sys/.../iio:deviceX/scan_elements/in_incli_y_en
 What:  /sys/.../iio:deviceX/scan_elements/in_pressureY_en
 What:  /sys/.../iio:deviceX/scan_elements/in_pressure_en
+What:  /sys/.../iio:deviceX/scan_elements/in_pulseY_en
+What:  /sys/.../iio:deviceX/scan_elements/in_pulse_en
 KernelVersion: 2.6.37
 Contact:   linux-...@vger.kernel.org
 Description:
@@ -799,6 +813,8 @@ What:   
/sys/.../iio:deviceX/scan_elements/in_voltageY_supply_type
 What:  /sys/.../iio:deviceX/scan_elements/in_timestamp_type
 What:  /sys/.../iio:deviceX/scan_elements/in_pressureY_type
 What:  /sys/.../iio:deviceX/scan_elements/in_pressure_type
+What:  /sys/.../iio:deviceX/scan_elements/in_pulseY_type
+What:  /sys/.../iio:deviceX/scan_elements/in_pulse_type
 KernelVersion: 2.6.37
 Contact:   linux-...@vger.kernel.org
 Description:
@@ -845,6 +861,8 @@ What:   
/sys/.../iio:deviceX/scan_elements/in_incli_y_index
 What:  /sys/.../iio:deviceX/scan_elements/in_timestamp_index
 What:  /sys/.../iio:deviceX/scan_elements/in_pressureY_index
 What:  /sys/.../iio:deviceX/scan_elements/in_pressure_index
+What:  /sys/.../iio:deviceX/scan_elements/in_pulseY_index
+What:  /sys/.../iio:deviceX/scan_elements/in_pulse_index
 KernelVersion: 2.6.37
 Contact:   linux-...@vger.kernel.org
 Description:
diff --git a/Documentation/ABI/testing/sysfs-bus-iio-pulse-tiecap 
b/Documentation/ABI/testing/sysfs-bus-iio-pulse-tiecap
new file mode 100644
index 000..a9e4a9f
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-bus-iio-pulse-tiecap
@@ -0,0 +1,9 @@
+What:  /sys/bus/iio/devices/iio:deviceX/pulse_polarityY
+What:  /sys/bus/iio/devices/iio:deviceX/pulse_polarity
+Date:  January 2014
+KernelVersion: 3.15
+Contact:   Matt Porter mpor...@linaro.org
+Description:
+   Get and set the polarity of the pulse signal to be captured
+   for channel Y.  1 indicates a high pulse signal and 0
+   indicates a low pulse signal.
-- 
1.8.4

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


[PATCH v2 1/6] iio: add support for pulse width capture devices

2014-02-03 Thread Matt Porter
Add a channel type to support pulse width capture devices.
These devices capture the timing of a PWM signal based on a
configurable trigger

Signed-off-by: Matt Porter mpor...@linaro.org
---
 drivers/iio/industrialio-core.c | 1 +
 include/linux/iio/types.h   | 1 +
 2 files changed, 2 insertions(+)

diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c
index acc911a..6ea0cf8 100644
--- a/drivers/iio/industrialio-core.c
+++ b/drivers/iio/industrialio-core.c
@@ -70,6 +70,7 @@ static const char * const iio_chan_type_name_spec[] = {
[IIO_CCT] = cct,
[IIO_PRESSURE] = pressure,
[IIO_HUMIDITYRELATIVE] = humidityrelative,
+   [IIO_PULSE] = pulse,
 };
 
 static const char * const iio_modifier_names[] = {
diff --git a/include/linux/iio/types.h b/include/linux/iio/types.h
index 084d882..4fa8840 100644
--- a/include/linux/iio/types.h
+++ b/include/linux/iio/types.h
@@ -30,6 +30,7 @@ enum iio_chan_type {
IIO_CCT,
IIO_PRESSURE,
IIO_HUMIDITYRELATIVE,
+   IIO_PULSE,
 };
 
 enum iio_modifier {
-- 
1.8.4

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


[PATCH v2 2/6] iio: pulse: add TI ECAP driver

2014-02-03 Thread Matt Porter
Adds support for capturing PWM signals using the TI ECAP peripheral.
This driver supports triggered buffer capture of pulses on multiple
ECAP instances. In addition, the driver supports configurable polarity
of the signal to be captured.

Signed-off-by: Matt Porter mpor...@linaro.org
---
 drivers/iio/pulse/Kconfig  |  20 ++
 drivers/iio/pulse/Makefile |   6 +
 drivers/iio/pulse/tiecap.c | 493 +
 3 files changed, 519 insertions(+)
 create mode 100644 drivers/iio/pulse/Kconfig
 create mode 100644 drivers/iio/pulse/Makefile
 create mode 100644 drivers/iio/pulse/tiecap.c

diff --git a/drivers/iio/pulse/Kconfig b/drivers/iio/pulse/Kconfig
new file mode 100644
index 000..9864d4b
--- /dev/null
+++ b/drivers/iio/pulse/Kconfig
@@ -0,0 +1,20 @@
+#
+# Pulse Capture Devices
+#
+# When adding new entries keep the list in alphabetical order
+
+menu Pulse Capture Devices
+
+config IIO_TIECAP
+   tristate TI ECAP Pulse Capture
+   depends on SOC_AM33XX
+   select IIO_BUFFER
+   select IIO_TRIGGERED_BUFFER
+   help
+If you say yes here you get support for the TI ECAP peripheral
+in pulse capture mode.
+
+This driver can also be built as a module.  If so, the module
+will be called tiecap
+
+endmenu
diff --git a/drivers/iio/pulse/Makefile b/drivers/iio/pulse/Makefile
new file mode 100644
index 000..94d4b00
--- /dev/null
+++ b/drivers/iio/pulse/Makefile
@@ -0,0 +1,6 @@
+#
+# Makefile for IIO PWM Capture Devices
+#
+
+# When adding new entries keep the list in alphabetical order
+obj-$(CONFIG_IIO_TIECAP)   += tiecap.o
diff --git a/drivers/iio/pulse/tiecap.c b/drivers/iio/pulse/tiecap.c
new file mode 100644
index 000..3d21080
--- /dev/null
+++ b/drivers/iio/pulse/tiecap.c
@@ -0,0 +1,493 @@
+/*
+ * ECAP IIO pulse capture driver
+ *
+ * Copyright (C) 2014 Linaro Limited
+ * Author: Matt Porter mpor...@linaro.org
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+#include linux/clk.h
+#include linux/err.h
+#include linux/iio/buffer.h
+#include linux/iio/iio.h
+#include linux/iio/sysfs.h
+#include linux/iio/trigger.h
+#include linux/iio/trigger_consumer.h
+#include linux/iio/triggered_buffer.h
+#include linux/io.h
+#include linux/interrupt.h
+#include linux/irq.h
+#include linux/module.h
+#include linux/of_device.h
+#include linux/platform_device.h
+#include linux/pm_runtime.h
+
+#include ../../pwm/pwm-tipwmss.h
+
+/* ECAP regs and bits */
+#define CAP1   0x08
+#define CAP2   0x0c
+#define ECCTL1 0x28
+#define ECCTL1_RUN_FREEBIT(15)
+#define ECCTL1_CAPLDEN BIT(8)
+#define ECCTL1_CAP2POL BIT(2)
+#define ECCTL1_CTRRST1 BIT(1)
+#define ECCTL1_CAP1POL BIT(0)
+#define ECCTL2 0x2a
+#define ECCTL2_SYNCO_SEL_DIS   BIT(7)
+#define ECCTL2_TSCTR_FREERUN   BIT(4)
+#define ECCTL2_REARM   BIT(3)
+#define ECCTL2_STOP_WRAP_2 BIT(1)
+#define ECEINT 0x2c
+#define ECFLG  0x2e
+#define ECCLR  0x30
+#define ECINT_CTRCMP   BIT(7)
+#define ECINT_CTRPRD   BIT(6)
+#define ECINT_CTROVF   BIT(5)
+#define ECINT_CEVT4BIT(4)
+#define ECINT_CEVT3BIT(3)
+#define ECINT_CEVT2BIT(2)
+#define ECINT_CEVT1BIT(1)
+#define ECINT_ALL  (ECINT_CTRCMP | \
+   ECINT_CTRPRD |  \
+   ECINT_CTROVF |  \
+   ECINT_CEVT4 |   \
+   ECINT_CEVT3 |   \
+   ECINT_CEVT2 |   \
+   ECINT_CEVT1)
+
+/* ECAP driver flags */
+#define ECAP_POLARITY_HIGH BIT(1)
+#define ECAP_ENABLED   BIT(0)
+
+struct ecap_context {
+   u32 cap1;
+   u32 cap2;
+   u16 ecctl1;
+   u16 ecctl2;
+   u16 eceint;
+};
+
+struct ecap_state {
+   unsigned long   flags;
+   unsigned intclk_rate;
+   void __iomem*regs;
+   u32 *buf;
+   struct ecap_context ctx;
+};
+
+#define dev_to_ecap_state(d)   iio_priv(dev_to_iio_dev(d))
+
+static const struct iio_chan_spec ecap_channels[] = {
+   {
+   .type   = IIO_PULSE,
+   .channel= 0,
+   .info_mask_separate =
+   BIT(IIO_CHAN_INFO_RAW) | BIT(IIO_CHAN_INFO_SCALE),
+   .scan_index = 0,
+   .scan_type = {
+   .sign   = 'u',
+   .realbits   = 32,
+   .storagebits= 32,
+   .endianness = IIO_LE,
+   },
+   

[PATCH v2 3/6] iio: enable selection and build of pulse drivers

2014-02-03 Thread Matt Porter
Add the pulse driver subdirectory when configuring and building
IIO.

Signed-off-by: Matt Porter mpor...@linaro.org
---
 drivers/iio/Kconfig  | 1 +
 drivers/iio/Makefile | 1 +
 2 files changed, 2 insertions(+)

diff --git a/drivers/iio/Kconfig b/drivers/iio/Kconfig
index 5dd0e12..286acc3 100644
--- a/drivers/iio/Kconfig
+++ b/drivers/iio/Kconfig
@@ -74,6 +74,7 @@ if IIO_TRIGGER
source drivers/iio/trigger/Kconfig
 endif #IIO_TRIGGER
 source drivers/iio/pressure/Kconfig
+source drivers/iio/pulse/Kconfig
 source drivers/iio/temperature/Kconfig
 
 endif # IIO
diff --git a/drivers/iio/Makefile b/drivers/iio/Makefile
index 887d390..9a953c9 100644
--- a/drivers/iio/Makefile
+++ b/drivers/iio/Makefile
@@ -24,5 +24,6 @@ obj-y += light/
 obj-y += magnetometer/
 obj-y += orientation/
 obj-y += pressure/
+obj-y += pulse/
 obj-y += temperature/
 obj-y += trigger/
-- 
1.8.4

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


v3.14-rc1 boot status

2014-02-03 Thread Nishanth Menon
Considering the major changes with clk nodes into DT, the following
are quick boot tests with device tree:

Quick boot sanity test (with a few patches for legacy platforms):

v3.14-rc1-omap2plus_defconfig
 1: am335x-evm:  Boot PASS: http://slexy.org/raw/s2AKEgkxU9
 2:  am335x-sk:  Boot PASS: http://slexy.org/raw/s20CdjJ4oo
 3: am3517-evm:  Boot PASS: http://slexy.org/raw/s21053Cq8K
 4:  am37x-evm:  Boot PASS: http://slexy.org/raw/s21E6m0UOt
 5: am43xx-epos:  Boot PASS: http://slexy.org/raw/s208teprqq
 6: BeagleBoard-XM:  Boot PASS: http://slexy.org/raw/s20OORN3oW
 7: BeagleBone-Black:  Boot PASS: http://slexy.org/raw/s21f8QQAjn
 8:  crane: No Image built - Missing platform support?:
 9:   dra7:  Boot PASS: http://slexy.org/raw/s21ZBXC2HR
10:ldp:  Boot PASS: http://slexy.org/raw/s21ZpTCgWR
11: PandaBoard-ES:  Boot PASS: http://slexy.org/raw/s21StYLTDC
12:sdp2430:  Boot PASS: http://slexy.org/raw/s21pkJQBCC
13:sdp3430:  Boot PASS: http://slexy.org/raw/s2P9r3VWN1
14:sdp4430:  Boot PASS: http://slexy.org/raw/s2wbnRJ9Bt
15: OMAP5432uEVM:  Boot PASS: http://slexy.org/raw/s20DkN9UcU
TOTAL = 15 boards, Booted Boards = 14, No Boot boards = 1

v3.14-rc1-multi_v7_defconfig
 1: am335x-evm:  Boot PASS: http://slexy.org/raw/s21Vpd4BiB
 2:  am335x-sk:  Boot PASS: http://slexy.org/raw/s21wdiu05m
 3: am3517-evm:  Boot PASS: http://slexy.org/raw/s21pFN5cLj
 4:  am37x-evm:  Boot PASS: http://slexy.org/raw/s2A6AIA1gm
 5: am43xx-epos:  Boot PASS: http://slexy.org/raw/s21B55p49v
 6: BeagleBoard-XM:  Boot PASS: http://slexy.org/raw/s20LRQIVtP
 7: BeagleBone-Black:  Boot PASS: http://slexy.org/raw/s21rflCYX9
 8:  crane: No Image built - Missing platform support?:
 9:   dra7:  Boot PASS: http://slexy.org/raw/s2029LQLsl
10:ldp:  Boot PASS: http://slexy.org/raw/s21QHWjLUH
11: PandaBoard-ES:  Boot PASS: http://slexy.org/raw/s20OxI5Z34
12:sdp2430:  Boot FAIL: http://slexy.org/raw/s21h8cCKLU
(expected fail: v6 platform)
13:sdp3430:  Boot PASS: http://slexy.org/raw/s2l3ecrzah
14:sdp4430:  Boot PASS: http://slexy.org/raw/s20lITWp6p
15: OMAP5432uEVM:  Boot PASS: http://slexy.org/raw/s2QkMn2zTL
TOTAL = 15 boards, Booted Boards = 13, No Boot boards = 2

-- 
Regards,
Nishanth Menon
--
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: omapfb segfaults

2014-02-03 Thread Grant
 omapfb segfaults on my Pandaboard ES across several different kernel
 versions including 3.13.1.  I've tried everything I can think of.  Any
 ideas?

 - Grant

This was fixed with the patches here:

https://github.com/archlinuxarm/PKGBUILDs/tree/master/alarm/xf86-video-omapfb

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


omapfb: resizing video doesn't work

2014-02-03 Thread Grant
I'm not able to resize video when using omapfb.  Should this work?

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


[PATCH v5 0/4] power_supply: Introduce power supply charging driver

2014-02-03 Thread Jenny TC
v1: introduced feature as a framework within power supply class driver with
separate files for battid framework and charging framework
v2: fixed review comments, moved macros and inline functions to power_supply.h
v3: moved the feature as a separate driver, combined battid framework and
charging framework inside the power supply charging driver. Moved
charger specific properties to power_supply_charger.h and plugged the
driver with power supply subsystem using power_supply_notifier
introduced in my previous patch. Also a sample charger chip driver
(bq24261) patch added to give more idea on the psy charging driver
usage
v4: Fixed review comments, no major design changes.
v5: Fixed makefile inconsistencies, removed unused pdata callbacks

The Power Supply charging driver connects multiple subsystems
to do charging in a generic way. The subsystems involves power_supply,
thermal and battery communication subsystems (1wire).With this the charging is
handled in a generic way.

The driver makes use of different new features - Battery Identification
interfaces, pluggable charging algorithms, charger cable arbitrations etc.
The patch also introduces generic interface for charger cable notifications.
Charger cable events and capabilities can be notified using the generic
power_supply_notifier chain.

Overall this driver removes the charging logic out of the charger chip driver
and the charger chip driver can just listen to the request from the power
supply charging driver to set the charger properties. This can be implemented
by exposing get_property and set property callbacks.

Jenny TC (4):
  power_supply: Add inlmt,iterm, min/max temp props
  power_supply: Introduce generic psy charging driver
  power_supply: Introduce PSE compliant algorithm
  power_supply: bq24261 charger driver

 Documentation/power/power_supply_charger.txt |  339 +++
 Documentation/power/power_supply_class.txt   |6 +
 drivers/power/Kconfig|   31 +
 drivers/power/Makefile   |3 +
 drivers/power/bq24261-charger.c  | 1364 ++
 drivers/power/charging_algo_pse.c|  198 
 drivers/power/power_supply_charger.c | 1196 ++
 drivers/power/power_supply_charger.h |  218 
 drivers/power/power_supply_core.c|3 +
 drivers/power/power_supply_sysfs.c   |4 +
 include/linux/power/bq24261-charger.h|   25 +
 include/linux/power/power_supply_charger.h   |  237 +
 include/linux/power_supply.h |  164 
 13 files changed, 3788 insertions(+)
 create mode 100644 Documentation/power/power_supply_charger.txt
 create mode 100644 drivers/power/bq24261-charger.c
 create mode 100644 drivers/power/charging_algo_pse.c
 create mode 100644 drivers/power/power_supply_charger.c
 create mode 100644 drivers/power/power_supply_charger.h
 create mode 100644 include/linux/power/bq24261-charger.h
 create mode 100644 include/linux/power/power_supply_charger.h

-- 
1.7.9.5

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


[PATCH 4/4] power_supply: bq24261 charger driver

2014-02-03 Thread Jenny TC
This patch introduces BQ24261 charger driver. The driver makes use of power
supply charging driver to setup charging. So the driver does hardware
abstraction and handles h/w specific corner cases. The charging logic resides
with power supply charging driver

Signed-off-by: Jenny TC jenny...@intel.com
---
 drivers/power/Kconfig |   10 +
 drivers/power/Makefile|1 +
 drivers/power/bq24261-charger.c   | 1358 +
 include/linux/power/bq24261-charger.h |   25 +
 4 files changed, 1394 insertions(+)
 create mode 100644 drivers/power/bq24261-charger.c
 create mode 100644 include/linux/power/bq24261-charger.h

diff --git a/drivers/power/Kconfig b/drivers/power/Kconfig
index 913ec36..a1c2780 100644
--- a/drivers/power/Kconfig
+++ b/drivers/power/Kconfig
@@ -409,6 +409,16 @@ config BATTERY_GOLDFISH
  Say Y to enable support for the battery and AC power in the
  Goldfish emulator.
 
+config CHARGER_BQ24261
+   tristate BQ24261 charger driver
+   select POWER_SUPPLY_CHARGER
+   depends on I2C
+   help
+ Say Y to include support for BQ24261 Charger driver. This driver
+ makes use of power supply charging driver. So the driver gives
+ the charger hardware abstraction only. Charging logic is abstracted
+ in the power supply charging driver.
+
 source drivers/power/reset/Kconfig
 
 endif # POWER_SUPPLY
diff --git a/drivers/power/Makefile b/drivers/power/Makefile
index 77535fd..9dde895 100644
--- a/drivers/power/Makefile
+++ b/drivers/power/Makefile
@@ -59,4 +59,5 @@ obj-$(CONFIG_CHARGER_BQ24735) += bq24735-charger.o
 obj-$(CONFIG_POWER_AVS)+= avs/
 obj-$(CONFIG_CHARGER_SMB347)   += smb347-charger.o
 obj-$(CONFIG_CHARGER_TPS65090) += tps65090-charger.o
+obj-$(CONFIG_CHARGER_BQ24261)  += bq24261-charger.o
 obj-$(CONFIG_POWER_RESET)  += reset/
diff --git a/drivers/power/bq24261-charger.c b/drivers/power/bq24261-charger.c
new file mode 100644
index 000..a87d1cc
--- /dev/null
+++ b/drivers/power/bq24261-charger.c
@@ -0,0 +1,1358 @@
+/*
+ * bq24261-charger.c - BQ24261 Charger I2C client driver
+ *
+ * Copyright (C) 2011 Intel Corporation
+ *
+ * ~~
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the GNU
+ * General Public License for more details.
+ *
+ * ~~
+ * Author: Jenny TC jenny...@intel.com
+ */
+
+#include linux/delay.h
+#include linux/device.h
+#include linux/err.h
+#include linux/i2c.h
+#include linux/init.h
+#include linux/interrupt.h
+#include linux/io.h
+#include linux/kernel.h
+#include linux/module.h
+#include linux/pm_runtime.h
+#include linux/power_supply.h
+#include linux/power/power_supply_charger.h
+#include linux/power/bq24261-charger.h
+#include linux/sched.h
+#include linux/seq_file.h
+#include linux/slab.h
+#include linux/usb/otg.h
+#include linux/version.h
+
+
+#define DEV_NAME bq24261_charger
+#define DEV_MANUFACTURER TI
+#define MODEL_NAME_SIZE 8
+#define DEV_MANUFACTURER_NAME_SIZE 4
+
+#define EXCEPTION_MONITOR_DELAY (60 * HZ)
+#define WDT_RESET_DELAY (15 * HZ)
+
+/* BQ24261 registers */
+#define BQ24261_STAT_CTRL0_ADDR0x00
+#define BQ24261_CTRL_ADDR  0x01
+#define BQ24261_BATT_VOL_CTRL_ADDR 0x02
+#define BQ24261_VENDOR_REV_ADDR0x03
+#define BQ24261_TERM_FCC_ADDR  0x04
+#define BQ24261_VINDPM_STAT_ADDR   0x05
+#define BQ24261_ST_NTC_MON_ADDR0x06
+
+#define BQ24261_RESET_MASK (0x01  7)
+#define BQ24261_RESET_ENABLE   (0x01  7)
+
+#define BQ24261_FAULT_MASK 0x07
+#define BQ24261_STAT_MASK  (0x03  4)
+#define BQ24261_BOOST_MASK (0x01  6)
+#define BQ24261_TMR_RST_MASK   (0x01  7)
+#define BQ24261_TMR_RST(0x01  7)
+
+#define BQ24261_ENABLE_BOOST   (0x01  6)
+
+#define BQ24261_VOVP   0x01
+#define BQ24261_LOW_SUPPLY 0x02
+#define BQ24261_THERMAL_SHUTDOWN   0x03
+#define BQ24261_BATT_TEMP_FAULT0x04
+#define BQ24261_TIMER_FAULT0x05
+#define BQ24261_BATT_OVP   0x06
+#define BQ24261_NO_BATTERY 0x07
+#define BQ24261_STAT_READY 0x00
+
+#define BQ24261_STAT_CHRG_PRGRSS   (0x01  4)
+#define BQ24261_STAT_CHRG_DONE (0x02  4)
+#define BQ24261_STAT_FAULT (0x03  4)
+
+#define BQ24261_CE_MASK(0x01  1)
+#define BQ24261_CE_DISABLE (0x01  1)
+

[PATCH 1/4] power_supply: Add inlmt,iterm, min/max temp props

2014-02-03 Thread Jenny TC
Add new power supply properties for input current, charge termination
current, min and max temperature

POWER_SUPPLY_PROP_TEMP_MIN - minimum operatable temperature
POWER_SUPPLY_PROP_TEMP_MAX - maximum operatable temperature

POWER_SUPPLY_PROP_INLMT - input current limit programmed by charger. Indicates
the input current for a charging source.

POWER_SUPPLY_PROP_CHARGE_TERM_CUR - Charge termination current used to detect
the end of charge condition

Signed-off-by: Jenny TC jenny...@intel.com
---
 Documentation/power/power_supply_class.txt |6 ++
 drivers/power/power_supply_sysfs.c |4 
 include/linux/power_supply.h   |4 
 3 files changed, 14 insertions(+)

diff --git a/Documentation/power/power_supply_class.txt 
b/Documentation/power/power_supply_class.txt
index 89a8816..48cff88 100644
--- a/Documentation/power/power_supply_class.txt
+++ b/Documentation/power/power_supply_class.txt
@@ -118,6 +118,10 @@ relative, time-based measurements.
 CONSTANT_CHARGE_CURRENT - constant charge current programmed by charger.
 CONSTANT_CHARGE_CURRENT_MAX - maximum charge current supported by the
 power supply object.
+INPUT_CURRENT_LIMIT - input current limit programmed by charger. Indicates
+the current drawn from a charging source.
+CHARGE_TERM_CURRENT - Charge termination current used to detect the end of 
charge
+condition.
 
 CONSTANT_CHARGE_VOLTAGE - constant charge voltage programmed by charger.
 CONSTANT_CHARGE_VOLTAGE_MAX - maximum charge voltage supported by the
@@ -140,6 +144,8 @@ TEMP_ALERT_MAX - maximum battery temperature alert.
 TEMP_AMBIENT - ambient temperature.
 TEMP_AMBIENT_ALERT_MIN - minimum ambient temperature alert.
 TEMP_AMBIENT_ALERT_MAX - maximum ambient temperature alert.
+TEMP_MIN - minimum operatable temperature
+TEMP_MAX - maximum operatable temperature
 
 TIME_TO_EMPTY - seconds left for battery to be considered empty (i.e.
 while battery powers a load)
diff --git a/drivers/power/power_supply_sysfs.c 
b/drivers/power/power_supply_sysfs.c
index 44420d1..750a202 100644
--- a/drivers/power/power_supply_sysfs.c
+++ b/drivers/power/power_supply_sysfs.c
@@ -167,6 +167,7 @@ static struct device_attribute power_supply_attrs[] = {
POWER_SUPPLY_ATTR(constant_charge_voltage_max),
POWER_SUPPLY_ATTR(charge_control_limit),
POWER_SUPPLY_ATTR(charge_control_limit_max),
+   POWER_SUPPLY_ATTR(input_current_limit),
POWER_SUPPLY_ATTR(energy_full_design),
POWER_SUPPLY_ATTR(energy_empty_design),
POWER_SUPPLY_ATTR(energy_full),
@@ -178,6 +179,8 @@ static struct device_attribute power_supply_attrs[] = {
POWER_SUPPLY_ATTR(capacity_alert_max),
POWER_SUPPLY_ATTR(capacity_level),
POWER_SUPPLY_ATTR(temp),
+   POWER_SUPPLY_ATTR(temp_max),
+   POWER_SUPPLY_ATTR(temp_min),
POWER_SUPPLY_ATTR(temp_alert_min),
POWER_SUPPLY_ATTR(temp_alert_max),
POWER_SUPPLY_ATTR(temp_ambient),
@@ -189,6 +192,7 @@ static struct device_attribute power_supply_attrs[] = {
POWER_SUPPLY_ATTR(time_to_full_avg),
POWER_SUPPLY_ATTR(type),
POWER_SUPPLY_ATTR(scope),
+   POWER_SUPPLY_ATTR(charge_term_current),
/* Properties of type `const char *' */
POWER_SUPPLY_ATTR(model_name),
POWER_SUPPLY_ATTR(manufacturer),
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h
index c9dc4e0..0278600 100644
--- a/include/linux/power_supply.h
+++ b/include/linux/power_supply.h
@@ -120,6 +120,7 @@ enum power_supply_property {
POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE_MAX,
POWER_SUPPLY_PROP_CHARGE_CONTROL_LIMIT,
POWER_SUPPLY_PROP_CHARGE_CONTROL_LIMIT_MAX,
+   POWER_SUPPLY_PROP_INPUT_CURRENT_LIMIT,
POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN,
POWER_SUPPLY_PROP_ENERGY_EMPTY_DESIGN,
POWER_SUPPLY_PROP_ENERGY_FULL,
@@ -131,6 +132,8 @@ enum power_supply_property {
POWER_SUPPLY_PROP_CAPACITY_ALERT_MAX, /* in percents! */
POWER_SUPPLY_PROP_CAPACITY_LEVEL,
POWER_SUPPLY_PROP_TEMP,
+   POWER_SUPPLY_PROP_TEMP_MAX,
+   POWER_SUPPLY_PROP_TEMP_MIN,
POWER_SUPPLY_PROP_TEMP_ALERT_MIN,
POWER_SUPPLY_PROP_TEMP_ALERT_MAX,
POWER_SUPPLY_PROP_TEMP_AMBIENT,
@@ -142,6 +145,7 @@ enum power_supply_property {
POWER_SUPPLY_PROP_TIME_TO_FULL_AVG,
POWER_SUPPLY_PROP_TYPE, /* use power_supply.type instead */
POWER_SUPPLY_PROP_SCOPE,
+   POWER_SUPPLY_PROP_CHARGE_TERM_CURRENT,
/* Properties of type `const char *' */
POWER_SUPPLY_PROP_MODEL_NAME,
POWER_SUPPLY_PROP_MANUFACTURER,
-- 
1.7.9.5

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


[PATCH 3/4] power_supply: Introduce PSE compliant algorithm

2014-02-03 Thread Jenny TC
As per Product Safety Engineering (PSE) specification for battery charging, the
battery characteristics and thereby the charging rates can vary on different
temperature zones. This patch introduces a PSE compliant charging algorithm with
maintenance charging support. The algorithm can be selected by the power supply
charging driver based on the type of the battery charging profile.

Signed-off-by: Jenny TC jenny...@intel.com
---
 drivers/power/Kconfig  |   13 ++
 drivers/power/Makefile |1 +
 drivers/power/charging_algo_pse.c  |  198 
 include/linux/power/power_supply_charger.h |   48 +++
 4 files changed, 260 insertions(+)
 create mode 100644 drivers/power/charging_algo_pse.c

diff --git a/drivers/power/Kconfig b/drivers/power/Kconfig
index f679f82..913ec36 100644
--- a/drivers/power/Kconfig
+++ b/drivers/power/Kconfig
@@ -22,6 +22,19 @@ config POWER_SUPPLY_CHARGER
  drivers to keep the charging logic outside and the charger driver
  just need to abstract the charger hardware.
 
+config POWER_SUPPLY_CHARGING_ALGO_PSE
+   bool PSE compliant charging algorithm
+   help
+ Say Y here to select Product Safety Engineering (PSE) compliant
+ charging algorithm. As per PSE standard the battery characteristics
+ and thereby the charging rates can vary on different temperature
+ zones. This config will enable PSE compliant charging algorithm with
+ maintenance charging support. At runtime the algorithm will be
+ selected by the psy charger driver based on the type of the battery
+ charging profile.
+
+   depends on POWER_SUPPLY_CHARGER
+
 config PDA_POWER
tristate Generic PDA/phone power driver
depends on !S390
diff --git a/drivers/power/Makefile b/drivers/power/Makefile
index 405f0f4..77535fd 100644
--- a/drivers/power/Makefile
+++ b/drivers/power/Makefile
@@ -8,6 +8,7 @@ obj-$(CONFIG_POWER_SUPPLY)  += power_supply.o
 obj-$(CONFIG_GENERIC_ADC_BATTERY)  += generic-adc-battery.o
 
 obj-$(CONFIG_POWER_SUPPLY_CHARGER) += power_supply_charger.o
+obj-$(CONFIG_POWER_SUPPLY_CHARGING_ALGO_PSE) += charging_algo_pse.o
 obj-$(CONFIG_PDA_POWER)+= pda_power.o
 obj-$(CONFIG_APM_POWER)+= apm_power.o
 obj-$(CONFIG_MAX8925_POWER)+= max8925_power.o
diff --git a/drivers/power/charging_algo_pse.c 
b/drivers/power/charging_algo_pse.c
new file mode 100644
index 000..0a0130a
--- /dev/null
+++ b/drivers/power/charging_algo_pse.c
@@ -0,0 +1,198 @@
+/*
+ * Copyright (C) 2012 Intel Corporation
+ *
+ * ~~
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the GNU
+ * General Public License for more details.
+ *
+ * ~~
+ * Author: Jenny TC jenny...@intel.com
+ */
+
+#include linux/module.h
+#include linux/types.h
+#include linux/init.h
+#include linux/slab.h
+#include linux/device.h
+#include linux/err.h
+#include linux/power_supply.h
+#include linux/thermal.h
+#include power_supply.h
+#include power_supply_charger.h
+
+/* 98% of CV is considered as voltage to detect Full */
+#define FULL_CV_MIN 98
+
+/* Offset to exit from maintenance charging. In maintenance charging
+*  if the volatge is less than the (maintenance_lower_threshold -
+*  MAINT_EXIT_OFFSET) then system can switch to normal charging
+*/
+#define MAINT_EXIT_OFFSET 50  /* mV */
+
+static int get_tempzone(struct psy_pse_chrg_prof *pse_mod_bprof,
+   int temp)
+{
+
+   int i = 0;
+   int temp_range_cnt = min_t(u16, pse_mod_bprof-temp_mon_ranges,
+   BATT_TEMP_NR_RNG);
+
+   if ((temp  pse_mod_bprof-temp_low_lim) ||
+   (temp  pse_mod_bprof-temp_mon_range[0].temp_up_lim))
+   return -EINVAL;
+
+   for (i = 0; i  temp_range_cnt; ++i)
+   if (temp  pse_mod_bprof-temp_mon_range[i].temp_up_lim)
+   break;
+   return i-1;
+}
+
+static inline bool __is_battery_full
+   (long volt, long cur, long iterm, unsigned long cv)
+{
+   pr_devel(%s:current=%ld pse_mod_bprof-chrg_term_mA =%ld 
voltage_now=%ld full_cond=%ld,
+   __func__, cur, iterm, volt * 100, (FULL_CV_MIN * cv));
+
+   return (cur  0)  (cur = iterm) 
+   ((volt * 100)  = (FULL_CV_MIN * cv));
+
+}
+
+static inline bool is_battery_full(struct psy_batt_props bat_prop,
+   struct psy_pse_chrg_prof *pse_mod_bprof, unsigned long cv)
+{
+
+