Linux Input/HID development
 help / color / mirror / Atom feed
* [PATCH v3 6/6] input: touchscreen: ti_am335x_tsc: Replace delta filtering with median filtering
From: Vignesh R @ 2014-11-11  8:34 UTC (permalink / raw)
  To: Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala,
	Benoit Cousson, Tony Lindgren, Russell King, Jonathan Cameron,
	Hartmut Knaack, richardcochran, Dmitry Torokhov, Lee Jones,
	Sebastian Andrzej Siewior
  Cc: Lars-Peter Clausen, Peter Meerwald, Samuel Ortiz, Felipe Balbi,
	Vignesh R, Brad Griffis, Sanjeev Sharma, Paul Gortmaker,
	Jan Kardell, devicetree, linux-kernel, linux-omap,
	linux-arm-kernel, linux-iio, linux-input
In-Reply-To: <1415694844-11230-1-git-send-email-vigneshr@ti.com>

Previously, delta filtering was applied TSC co-ordinate readouts before
reporting a single value to user space. This patch replaces delta filtering
with median filtering. Median filtering sorts co-ordinate readouts, drops min
and max values, and reports the average of remaining values. This method is
more sensible than delta filering. Median filtering is applied only if number
of readouts is greater than 3 else just average of co-ordinate readouts is
reported.

Signed-off-by: Vignesh R <vigneshr@ti.com>
---
 drivers/input/touchscreen/ti_am335x_tsc.c | 91 +++++++++++++++++--------------
 1 file changed, 51 insertions(+), 40 deletions(-)

diff --git a/drivers/input/touchscreen/ti_am335x_tsc.c b/drivers/input/touchscreen/ti_am335x_tsc.c
index 20ce76b1b6e7..e1df470946e6 100644
--- a/drivers/input/touchscreen/ti_am335x_tsc.c
+++ b/drivers/input/touchscreen/ti_am335x_tsc.c
@@ -26,6 +26,7 @@
 #include <linux/delay.h>
 #include <linux/of.h>
 #include <linux/of_device.h>
+#include <linux/sort.h>
 
 #include <linux/mfd/ti_am335x_tscadc.h>
 
@@ -204,56 +205,61 @@ static void titsc_step_config(struct titsc *ts_dev)
 	am335x_tsc_se_set_cache(ts_dev->mfd_tscadc, ts_dev->step_mask);
 }
 
+static int titsc_cmp_coord(const void *a, const void *b)
+{
+	return *(int *)a - *(int *)b;
+}
+
 static void titsc_read_coordinates(struct titsc *ts_dev,
 		u32 *x, u32 *y, u32 *z1, u32 *z2)
 {
-	unsigned int fifocount = titsc_readl(ts_dev, REG_FIFO0CNT);
-	unsigned int prev_val_x = ~0, prev_val_y = ~0;
-	unsigned int prev_diff_x = ~0, prev_diff_y = ~0;
-	unsigned int read, diff;
-	unsigned int i, channel;
+	unsigned int yvals[7], xvals[7];
+	unsigned int i, xsum = 0, ysum = 0;
 	unsigned int creads = ts_dev->coordinate_readouts;
-	unsigned int first_step = TOTAL_STEPS - (creads * 2 + 2);
 
-	*z1 = *z2 = 0;
-	if (fifocount % (creads * 2 + 2))
-		fifocount -= fifocount % (creads * 2 + 2);
-	/*
-	 * Delta filter is used to remove large variations in sampled
-	 * values from ADC. The filter tries to predict where the next
-	 * coordinate could be. This is done by taking a previous
-	 * coordinate and subtracting it form current one. Further the
-	 * algorithm compares the difference with that of a present value,
-	 * if true the value is reported to the sub system.
-	 */
-	for (i = 0; i < fifocount; i++) {
-		read = titsc_readl(ts_dev, REG_FIFO0);
-
-		channel = (read & 0xf0000) >> 16;
-		read &= 0xfff;
-		if (channel > first_step + creads + 2) {
-			diff = abs(read - prev_val_x);
-			if (diff < prev_diff_x) {
-				prev_diff_x = diff;
-				*x = read;
-			}
-			prev_val_x = read;
+	for (i = 0; i < creads; i++) {
+		yvals[i] = titsc_readl(ts_dev, REG_FIFO0);
+		yvals[i] &= 0xfff;
+	}
 
-		} else if (channel == first_step + creads + 1) {
-			*z1 = read;
+	*z1 = titsc_readl(ts_dev, REG_FIFO0);
+	*z1 &= 0xfff;
+	*z2 = titsc_readl(ts_dev, REG_FIFO0);
+	*z2 &= 0xfff;
 
-		} else if (channel == first_step + creads + 2) {
-			*z2 = read;
+	for (i = 0; i < creads; i++) {
+		xvals[i] = titsc_readl(ts_dev, REG_FIFO0);
+		xvals[i] &= 0xfff;
+	}
 
-		} else if (channel > first_step) {
-			diff = abs(read - prev_val_y);
-			if (diff < prev_diff_y) {
-				prev_diff_y = diff;
-				*y = read;
-			}
-			prev_val_y = read;
+	/*
+	 * If co-ordinates readouts is less than 4 then
+	 * report the average. In case of 4 or more
+	 * readouts, sort the co-ordinate samples, drop
+	 * min and max values and report the average of
+	 * remaining values.
+	 */
+	if (creads <=  3) {
+		for (i = 0; i < creads; i++) {
+			ysum += yvals[i];
+			xsum += xvals[i];
 		}
+		ysum /= creads;
+		xsum /= creads;
+	} else {
+		sort(yvals, creads, sizeof(unsigned int),
+		     titsc_cmp_coord, NULL);
+		sort(xvals, creads, sizeof(unsigned int),
+		     titsc_cmp_coord, NULL);
+		for (i = 1; i < creads - 1; i++) {
+			ysum += yvals[i];
+			xsum += xvals[i];
+		}
+		ysum /= creads - 2;
+		xsum /= creads - 2;
 	}
+	*y = ysum;
+	*x = xsum;
 }
 
 static irqreturn_t titsc_irq(int irq, void *dev)
@@ -362,6 +368,11 @@ static int titsc_parse_dt(struct platform_device *pdev,
 	if (err < 0)
 		return err;
 
+	if (ts_dev->coordinate_readouts <= 0) {
+		dev_warn(&pdev->dev, "invalid co-ordinate readouts, resetting it to 5\n");
+		ts_dev->coordinate_readouts = 5;
+	}
+
 	err = of_property_read_u32(node, "ti,charge-delay",
 				   &ts_dev->charge_delay);
 	if (err < 0)
-- 
1.9.1

^ permalink raw reply related

* [PATCH v3 5/6] input: touchscreen: ti_am335x_tsc: Use charge delay DT parameter
From: Vignesh R @ 2014-11-11  8:34 UTC (permalink / raw)
  To: Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala,
	Benoit Cousson, Tony Lindgren, Russell King, Jonathan Cameron,
	Hartmut Knaack, richardcochran-Re5JQEeQqe8AvxtiuMwx3w,
	Dmitry Torokhov, Lee Jones, Sebastian Andrzej Siewior
  Cc: Lars-Peter Clausen, Peter Meerwald, Samuel Ortiz, Felipe Balbi,
	Vignesh R, Brad Griffis, Sanjeev Sharma, Paul Gortmaker,
	Jan Kardell, devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-omap-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-iio-u79uwXL29TY76Z2rM5mHXA,
	linux-input-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1415694844-11230-1-git-send-email-vigneshr-l0cyMroinI0@public.gmane.org>

This patch reads charge delay from tsc DT node and writes to
REG_CHARGEDELAY register. If the charge delay is not specified in DT
then default value of 0xB000(CHARGEDLY_OPENDLY) is used.

Signed-off-by: Vignesh R <vigneshr-l0cyMroinI0@public.gmane.org>
---
 drivers/input/touchscreen/ti_am335x_tsc.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/input/touchscreen/ti_am335x_tsc.c b/drivers/input/touchscreen/ti_am335x_tsc.c
index 483fd97c0e0c..20ce76b1b6e7 100644
--- a/drivers/input/touchscreen/ti_am335x_tsc.c
+++ b/drivers/input/touchscreen/ti_am335x_tsc.c
@@ -52,6 +52,7 @@ struct titsc {
 	u32			bit_xp, bit_xn, bit_yp, bit_yn;
 	u32			inp_xp, inp_xn, inp_yp, inp_yn;
 	u32			step_mask;
+	u32			charge_delay;
 };
 
 static unsigned int titsc_readl(struct titsc *ts, unsigned int reg)
@@ -177,7 +178,7 @@ static void titsc_step_config(struct titsc *ts_dev)
 
 	config = titsc_readl(ts_dev, REG_IDLECONFIG);
 	titsc_writel(ts_dev, REG_CHARGECONFIG, config);
-	titsc_writel(ts_dev, REG_CHARGEDELAY, CHARGEDLY_OPENDLY);
+	titsc_writel(ts_dev, REG_CHARGEDELAY, ts_dev->charge_delay);
 
 	/* coordinate_readouts + 1 ... coordinate_readouts + 2 is for Z */
 	config = STEPCONFIG_MODE_HWSYNC |
@@ -361,6 +362,11 @@ static int titsc_parse_dt(struct platform_device *pdev,
 	if (err < 0)
 		return err;
 
+	err = of_property_read_u32(node, "ti,charge-delay",
+				   &ts_dev->charge_delay);
+	if (err < 0)
+		ts_dev->charge_delay = CHARGEDLY_OPENDLY;
+
 	return of_property_read_u32_array(node, "ti,wire-config",
 			ts_dev->config_inp, ARRAY_SIZE(ts_dev->config_inp));
 }
-- 
1.9.1

^ permalink raw reply related

* [PATCH v3 4/6] ARM: dts: AM335x: Make charge delay a DT parameter for tsc
From: Vignesh R @ 2014-11-11  8:34 UTC (permalink / raw)
  To: Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala,
	Benoit Cousson, Tony Lindgren, Russell King, Jonathan Cameron,
	Hartmut Knaack, richardcochran, Dmitry Torokhov, Lee Jones,
	Sebastian Andrzej Siewior
  Cc: devicetree, linux-iio, Lars-Peter Clausen, Brad Griffis,
	Jan Kardell, Vignesh R, linux-kernel, Felipe Balbi,
	Paul Gortmaker, Peter Meerwald, linux-input, Sanjeev Sharma,
	linux-omap, linux-arm-kernel, Samuel Ortiz
In-Reply-To: <1415694844-11230-1-git-send-email-vigneshr@ti.com>

The charge delay value is by default 0xB000. But it can be set to lower
values on some boards as long as false pen-ups are avoided. Lowering the
value increases the sampling rate (though current sampling rate is
sufficient for tsc operation). Hence charge delay has been made a DT
parameter.

Signed-off-by: Vignesh R <vigneshr@ti.com>
---
 .../devicetree/bindings/input/touchscreen/ti-tsc-adc.txt  | 15 +++++++++++++++
 arch/arm/boot/dts/am335x-evm.dts                          |  1 +
 2 files changed, 16 insertions(+)

diff --git a/Documentation/devicetree/bindings/input/touchscreen/ti-tsc-adc.txt b/Documentation/devicetree/bindings/input/touchscreen/ti-tsc-adc.txt
index 878549ba814d..b87574bae009 100644
--- a/Documentation/devicetree/bindings/input/touchscreen/ti-tsc-adc.txt
+++ b/Documentation/devicetree/bindings/input/touchscreen/ti-tsc-adc.txt
@@ -28,6 +28,20 @@ Required properties:
 	ti,adc-channels: List of analog inputs available for ADC.
 			 AIN0 = 0, AIN1 = 1 and so on till AIN7 = 7.
 
+Optional properties:
+- child "tsc"
+	ti,charge-delay: Length of touch screen charge delay step in terms of
+			 ADC clock cycles. Charge delay value should be large
+			 in order to avoid false pen-up events. This value
+			 affects the overall sampling speed, hence need to be
+			 kept as low as possible, while avoiding false pen-up
+			 event. Start from a lower value, say 0x400, and
+			 increase value until false pen-up events are avoided.
+			 The pen-up detection happens immediately after the
+			 charge step, so this does in fact function as a
+			 hardware knob for adjusting the amount of "settling
+			 time".
+
 Example:
 	tscadc: tscadc@44e0d000 {
 		compatible = "ti,am3359-tscadc";
@@ -36,6 +50,7 @@ Example:
 			ti,x-plate-resistance = <200>;
 			ti,coordiante-readouts = <5>;
 			ti,wire-config = <0x00 0x11 0x22 0x33>;
+			ti,charge-delay = <0xB000>;
 		};
 
 		adc {
diff --git a/arch/arm/boot/dts/am335x-evm.dts b/arch/arm/boot/dts/am335x-evm.dts
index e2156a583de7..80be0462298b 100644
--- a/arch/arm/boot/dts/am335x-evm.dts
+++ b/arch/arm/boot/dts/am335x-evm.dts
@@ -641,6 +641,7 @@
 		ti,x-plate-resistance = <200>;
 		ti,coordinate-readouts = <5>;
 		ti,wire-config = <0x00 0x11 0x22 0x33>;
+		ti,charge-delay = <0xB000>;
 	};
 
 	adc {
-- 
1.9.1

^ permalink raw reply related

* [PATCH v3 3/6] mfd: ti_am335x_tscadc: Remove unwanted reg_se_cache save
From: Vignesh R @ 2014-11-11  8:34 UTC (permalink / raw)
  To: Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala,
	Benoit Cousson, Tony Lindgren, Russell King, Jonathan Cameron,
	Hartmut Knaack, richardcochran, Dmitry Torokhov, Lee Jones,
	Sebastian Andrzej Siewior
  Cc: Lars-Peter Clausen, Peter Meerwald, Samuel Ortiz, Felipe Balbi,
	Vignesh R, Brad Griffis, Sanjeev Sharma, Paul Gortmaker,
	Jan Kardell, devicetree, linux-kernel, linux-omap,
	linux-arm-kernel, linux-iio, linux-input
In-Reply-To: <1415694844-11230-1-git-send-email-vigneshr@ti.com>

In one shot mode, sequencer automatically disables all enabled steps at
the end of each cycle. (both ADC steps and TSC steps) Hence these steps
need not be saved in reg_se_cache for clearing these steps at a later
stage.
Also, when ADC wakes up Sequencer should not be busy executing any of the
config steps except for the charge step. Previously charge step was 1 ADC
clock cycle and hence it was ignored.

Signed-off-by: Vignesh R <vigneshr@ti.com>
---
 drivers/mfd/ti_am335x_tscadc.c       | 7 +++++--
 include/linux/mfd/ti_am335x_tscadc.h | 1 +
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/mfd/ti_am335x_tscadc.c b/drivers/mfd/ti_am335x_tscadc.c
index d877e777cce6..110038859a8d 100644
--- a/drivers/mfd/ti_am335x_tscadc.c
+++ b/drivers/mfd/ti_am335x_tscadc.c
@@ -86,8 +86,12 @@ static void am335x_tscadc_need_adc(struct ti_tscadc_dev *tsadc)
 		spin_lock_irq(&tsadc->reg_lock);
 		finish_wait(&tsadc->reg_se_wait, &wait);
 
+		/*
+		 * Sequencer should either be idle or
+		 * busy applying the charge step.
+		 */
 		reg = tscadc_readl(tsadc, REG_ADCFSM);
-		WARN_ON(reg & SEQ_STATUS);
+		WARN_ON((reg & SEQ_STATUS) && !(reg & CHARGE_STEP));
 		tsadc->adc_waiting = false;
 	}
 	tsadc->adc_in_use = true;
@@ -96,7 +100,6 @@ static void am335x_tscadc_need_adc(struct ti_tscadc_dev *tsadc)
 void am335x_tsc_se_set_once(struct ti_tscadc_dev *tsadc, u32 val)
 {
 	spin_lock_irq(&tsadc->reg_lock);
-	tsadc->reg_se_cache |= val;
 	am335x_tscadc_need_adc(tsadc);
 
 	tscadc_writel(tsadc, REG_SE, val);
diff --git a/include/linux/mfd/ti_am335x_tscadc.h b/include/linux/mfd/ti_am335x_tscadc.h
index c99be5dc0f5c..fcce182e4a35 100644
--- a/include/linux/mfd/ti_am335x_tscadc.h
+++ b/include/linux/mfd/ti_am335x_tscadc.h
@@ -128,6 +128,7 @@
 
 /* Sequencer Status */
 #define SEQ_STATUS BIT(5)
+#define CHARGE_STEP		0x11
 
 #define ADC_CLK			3000000
 #define TOTAL_STEPS		16
-- 
1.9.1

^ permalink raw reply related

* [PATCH v3 2/6] input: touchscreen: ti_am335x_tsc: Remove udelay in interrupt handler
From: Vignesh R @ 2014-11-11  8:34 UTC (permalink / raw)
  To: Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala,
	Benoit Cousson, Tony Lindgren, Russell King, Jonathan Cameron,
	Hartmut Knaack, richardcochran, Dmitry Torokhov, Lee Jones,
	Sebastian Andrzej Siewior
  Cc: devicetree, linux-iio, Lars-Peter Clausen, Brad Griffis,
	Jan Kardell, Vignesh R, linux-kernel, Felipe Balbi,
	Paul Gortmaker, Peter Meerwald, linux-input, Sanjeev Sharma,
	linux-omap, linux-arm-kernel, Samuel Ortiz
In-Reply-To: <1415694844-11230-1-git-send-email-vigneshr@ti.com>

From: Brad Griffis <bgriffis@ti.com>

TSC interrupt handler had udelay to avoid reporting of false pen-up
interrupt to user space. This patch implements workaround suggesting in
Advisory 1.0.31 of silicon errata for am335x, thus eliminating udelay
and touchscreen lag. This also improves performance of touchscreen and
eliminates sudden jump of cursor at touch release.

IDLECONFIG and CHARGECONFIG registers are to be configured
with same values in order to eliminate false pen-up events. This
workaround may result in false pen-down to be detected, hence considerable
charge step delay needs to be added. The charge delay is set to 0xB000
(in terms of ADC clock cycles) by default.

TSC steps are disabled at the end of every sampling cycle and EOS bit is
set. Once the EOS bit is set, the TSC steps need to be re-enabled to begin
next sampling cycle.

Signed-off-by: Brad Griffis <bgriffis@ti.com>
[vigneshr@ti.com: Ported the patch from v3.12 to v3.18rc2]

Signed-off-by: Vignesh R <vigneshr@ti.com>
Acked-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/input/touchscreen/ti_am335x_tsc.c | 56 ++++++++++++-------------------
 include/linux/mfd/ti_am335x_tscadc.h      |  3 +-
 2 files changed, 24 insertions(+), 35 deletions(-)

diff --git a/drivers/input/touchscreen/ti_am335x_tsc.c b/drivers/input/touchscreen/ti_am335x_tsc.c
index 1aeac9675fe7..483fd97c0e0c 100644
--- a/drivers/input/touchscreen/ti_am335x_tsc.c
+++ b/drivers/input/touchscreen/ti_am335x_tsc.c
@@ -173,11 +173,9 @@ static void titsc_step_config(struct titsc *ts_dev)
 		titsc_writel(ts_dev, REG_STEPDELAY(i), STEPCONFIG_OPENDLY);
 	}
 
-	/* Charge step configuration */
-	config = ts_dev->bit_xp | ts_dev->bit_yn |
-			STEPCHARGE_RFP_XPUL | STEPCHARGE_RFM_XNUR |
-			STEPCHARGE_INM_AN1 | STEPCHARGE_INP(ts_dev->inp_yp);
+	/* Make CHARGECONFIG same as IDLECONFIG */
 
+	config = titsc_readl(ts_dev, REG_IDLECONFIG);
 	titsc_writel(ts_dev, REG_CHARGECONFIG, config);
 	titsc_writel(ts_dev, REG_CHARGEDELAY, CHARGEDLY_OPENDLY);
 
@@ -264,9 +262,26 @@ static irqreturn_t titsc_irq(int irq, void *dev)
 	unsigned int status, irqclr = 0;
 	unsigned int x = 0, y = 0;
 	unsigned int z1, z2, z;
-	unsigned int fsm;
 
-	status = titsc_readl(ts_dev, REG_IRQSTATUS);
+	status = titsc_readl(ts_dev, REG_RAWIRQSTATUS);
+	if (status & IRQENB_HW_PEN) {
+		ts_dev->pen_down = true;
+		titsc_writel(ts_dev, REG_IRQWAKEUP, 0x00);
+		titsc_writel(ts_dev, REG_IRQCLR, IRQENB_HW_PEN);
+		irqclr |= IRQENB_HW_PEN;
+	}
+
+	if (status & IRQENB_PENUP) {
+		ts_dev->pen_down = false;
+		input_report_key(input_dev, BTN_TOUCH, 0);
+		input_report_abs(input_dev, ABS_PRESSURE, 0);
+		input_sync(input_dev);
+		irqclr |= IRQENB_PENUP;
+	}
+
+	if (status & IRQENB_EOS)
+		irqclr |= IRQENB_EOS;
+
 	/*
 	 * ADC and touchscreen share the IRQ line.
 	 * FIFO1 interrupts are used by ADC. Handle FIFO0 IRQs here only
@@ -297,34 +312,6 @@ static irqreturn_t titsc_irq(int irq, void *dev)
 		}
 		irqclr |= IRQENB_FIFO0THRES;
 	}
-
-	/*
-	 * Time for sequencer to settle, to read
-	 * correct state of the sequencer.
-	 */
-	udelay(SEQ_SETTLE);
-
-	status = titsc_readl(ts_dev, REG_RAWIRQSTATUS);
-	if (status & IRQENB_PENUP) {
-		/* Pen up event */
-		fsm = titsc_readl(ts_dev, REG_ADCFSM);
-		if (fsm == ADCFSM_STEPID) {
-			ts_dev->pen_down = false;
-			input_report_key(input_dev, BTN_TOUCH, 0);
-			input_report_abs(input_dev, ABS_PRESSURE, 0);
-			input_sync(input_dev);
-		} else {
-			ts_dev->pen_down = true;
-		}
-		irqclr |= IRQENB_PENUP;
-	}
-
-	if (status & IRQENB_HW_PEN) {
-
-		titsc_writel(ts_dev, REG_IRQWAKEUP, 0x00);
-		titsc_writel(ts_dev, REG_IRQCLR, IRQENB_HW_PEN);
-	}
-
 	if (irqclr) {
 		titsc_writel(ts_dev, REG_IRQSTATUS, irqclr);
 		am335x_tsc_se_set_cache(ts_dev->mfd_tscadc, ts_dev->step_mask);
@@ -417,6 +404,7 @@ static int titsc_probe(struct platform_device *pdev)
 	}
 
 	titsc_writel(ts_dev, REG_IRQENABLE, IRQENB_FIFO0THRES);
+	titsc_writel(ts_dev, REG_IRQENABLE, IRQENB_EOS);
 	err = titsc_config_wires(ts_dev);
 	if (err) {
 		dev_err(&pdev->dev, "wrong i/p wire configuration\n");
diff --git a/include/linux/mfd/ti_am335x_tscadc.h b/include/linux/mfd/ti_am335x_tscadc.h
index e2e70053470e..c99be5dc0f5c 100644
--- a/include/linux/mfd/ti_am335x_tscadc.h
+++ b/include/linux/mfd/ti_am335x_tscadc.h
@@ -52,6 +52,7 @@
 
 /* IRQ enable */
 #define IRQENB_HW_PEN		BIT(0)
+#define IRQENB_EOS		BIT(1)
 #define IRQENB_FIFO0THRES	BIT(2)
 #define IRQENB_FIFO0OVRRUN	BIT(3)
 #define IRQENB_FIFO0UNDRFLW	BIT(4)
@@ -107,7 +108,7 @@
 /* Charge delay */
 #define CHARGEDLY_OPEN_MASK	(0x3FFFF << 0)
 #define CHARGEDLY_OPEN(val)	((val) << 0)
-#define CHARGEDLY_OPENDLY	CHARGEDLY_OPEN(1)
+#define CHARGEDLY_OPENDLY	CHARGEDLY_OPEN(0xB000)
 
 /* Control register */
 #define CNTRLREG_TSCSSENB	BIT(0)
-- 
1.9.1

^ permalink raw reply related

* [PATCH v3 1/6] input: touchscreen: ti_am335x_tsc Interchange touchscreen and ADC steps
From: Vignesh R @ 2014-11-11  8:33 UTC (permalink / raw)
  To: Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala,
	Benoit Cousson, Tony Lindgren, Russell King, Jonathan Cameron,
	Hartmut Knaack, richardcochran, Dmitry Torokhov, Lee Jones,
	Sebastian Andrzej Siewior
  Cc: devicetree, linux-iio, Lars-Peter Clausen, Brad Griffis,
	Jan Kardell, Vignesh R, linux-kernel, Felipe Balbi,
	Paul Gortmaker, Peter Meerwald, linux-input, Sanjeev Sharma,
	linux-omap, linux-arm-kernel, Samuel Ortiz
In-Reply-To: <1415694844-11230-1-git-send-email-vigneshr@ti.com>

From: Brad Griffis <bgriffis@ti.com>

This patch makes the initial changes required to workaround TSC-false
pen-up interrupts. It is required to implement these changes in order to
remove udelay in the TSC interrupt handler and false pen-up events.
The charge step is to be executed immediately after sampling X+. Hence
TSC is made to use higher numbered steps (steps 5 to 16 for 5 co-ordinate
readouts, 4 wire TSC configuration) and ADC to use lower ones. Further
X co-ordinate readouts must be the last to be sampled, thus co-ordinates
are sampled in the order Y-Z-X.

Signed-off-by: Brad Griffis <bgriffis@ti.com>
[vigneshr@ti.com: Ported the patch from v3.12 to v3.18rc2]

Signed-off-by: Vignesh R <vigneshr@ti.com>
Acked-by: Jonathan Cameron <jic23@kernel.org>
---
 drivers/iio/adc/ti_am335x_adc.c           |  5 ++--
 drivers/input/touchscreen/ti_am335x_tsc.c | 42 ++++++++++++++++++-------------
 2 files changed, 26 insertions(+), 21 deletions(-)

diff --git a/drivers/iio/adc/ti_am335x_adc.c b/drivers/iio/adc/ti_am335x_adc.c
index b730864731e8..adba23246474 100644
--- a/drivers/iio/adc/ti_am335x_adc.c
+++ b/drivers/iio/adc/ti_am335x_adc.c
@@ -86,19 +86,18 @@ static void tiadc_step_config(struct iio_dev *indio_dev)
 {
 	struct tiadc_device *adc_dev = iio_priv(indio_dev);
 	unsigned int stepconfig;
-	int i, steps;
+	int i, steps = 0;
 
 	/*
 	 * There are 16 configurable steps and 8 analog input
 	 * lines available which are shared between Touchscreen and ADC.
 	 *
-	 * Steps backwards i.e. from 16 towards 0 are used by ADC
+	 * Steps forwards i.e. from 0 towards 16 are used by ADC
 	 * depending on number of input lines needed.
 	 * Channel would represent which analog input
 	 * needs to be given to ADC to digitalize data.
 	 */
 
-	steps = TOTAL_STEPS - adc_dev->channels;
 	if (iio_buffer_enabled(indio_dev))
 		stepconfig = STEPCONFIG_AVG_16 | STEPCONFIG_FIFO1
 					| STEPCONFIG_MODE_SWCNT;
diff --git a/drivers/input/touchscreen/ti_am335x_tsc.c b/drivers/input/touchscreen/ti_am335x_tsc.c
index 2ce649520fe0..1aeac9675fe7 100644
--- a/drivers/input/touchscreen/ti_am335x_tsc.c
+++ b/drivers/input/touchscreen/ti_am335x_tsc.c
@@ -121,7 +121,7 @@ static void titsc_step_config(struct titsc *ts_dev)
 {
 	unsigned int	config;
 	int i;
-	int end_step;
+	int end_step, first_step, tsc_steps;
 	u32 stepenable;
 
 	config = STEPCONFIG_MODE_HWSYNC |
@@ -140,9 +140,11 @@ static void titsc_step_config(struct titsc *ts_dev)
 		break;
 	}
 
-	/* 1 … coordinate_readouts is for X */
-	end_step = ts_dev->coordinate_readouts;
-	for (i = 0; i < end_step; i++) {
+	tsc_steps = ts_dev->coordinate_readouts * 2 + 2;
+	first_step = TOTAL_STEPS - tsc_steps;
+	/* Steps 16 to 16-coordinate_readouts is for X */
+	end_step = first_step + tsc_steps;
+	for (i = end_step - ts_dev->coordinate_readouts; i < end_step; i++) {
 		titsc_writel(ts_dev, REG_STEPCONFIG(i), config);
 		titsc_writel(ts_dev, REG_STEPDELAY(i), STEPCONFIG_OPENDLY);
 	}
@@ -164,9 +166,9 @@ static void titsc_step_config(struct titsc *ts_dev)
 		break;
 	}
 
-	/* coordinate_readouts … coordinate_readouts * 2 is for Y */
-	end_step = ts_dev->coordinate_readouts * 2;
-	for (i = ts_dev->coordinate_readouts; i < end_step; i++) {
+	/* 1 ... coordinate_readouts is for Y */
+	end_step = first_step + ts_dev->coordinate_readouts;
+	for (i = first_step; i < end_step; i++) {
 		titsc_writel(ts_dev, REG_STEPCONFIG(i), config);
 		titsc_writel(ts_dev, REG_STEPDELAY(i), STEPCONFIG_OPENDLY);
 	}
@@ -179,7 +181,7 @@ static void titsc_step_config(struct titsc *ts_dev)
 	titsc_writel(ts_dev, REG_CHARGECONFIG, config);
 	titsc_writel(ts_dev, REG_CHARGEDELAY, CHARGEDLY_OPENDLY);
 
-	/* coordinate_readouts * 2 … coordinate_readouts * 2 + 2 is for Z */
+	/* coordinate_readouts + 1 ... coordinate_readouts + 2 is for Z */
 	config = STEPCONFIG_MODE_HWSYNC |
 			STEPCONFIG_AVG_16 | ts_dev->bit_yp |
 			ts_dev->bit_xn | STEPCONFIG_INM_ADCREFM |
@@ -194,8 +196,11 @@ static void titsc_step_config(struct titsc *ts_dev)
 	titsc_writel(ts_dev, REG_STEPDELAY(end_step),
 			STEPCONFIG_OPENDLY);
 
-	/* The steps1 … end and bit 0 for TS_Charge */
-	stepenable = (1 << (end_step + 2)) - 1;
+	/* The steps end ... end - readouts * 2 + 2 and bit 0 for TS_Charge */
+	stepenable = 1;
+	for (i = 0; i < tsc_steps; i++)
+		stepenable |= 1 << (first_step + i + 1);
+
 	ts_dev->step_mask = stepenable;
 	am335x_tsc_se_set_cache(ts_dev->mfd_tscadc, ts_dev->step_mask);
 }
@@ -209,6 +214,7 @@ static void titsc_read_coordinates(struct titsc *ts_dev,
 	unsigned int read, diff;
 	unsigned int i, channel;
 	unsigned int creads = ts_dev->coordinate_readouts;
+	unsigned int first_step = TOTAL_STEPS - (creads * 2 + 2);
 
 	*z1 = *z2 = 0;
 	if (fifocount % (creads * 2 + 2))
@@ -226,7 +232,7 @@ static void titsc_read_coordinates(struct titsc *ts_dev,
 
 		channel = (read & 0xf0000) >> 16;
 		read &= 0xfff;
-		if (channel < creads) {
+		if (channel > first_step + creads + 2) {
 			diff = abs(read - prev_val_x);
 			if (diff < prev_diff_x) {
 				prev_diff_x = diff;
@@ -234,19 +240,19 @@ static void titsc_read_coordinates(struct titsc *ts_dev,
 			}
 			prev_val_x = read;
 
-		} else if (channel < creads * 2) {
+		} else if (channel == first_step + creads + 1) {
+			*z1 = read;
+
+		} else if (channel == first_step + creads + 2) {
+			*z2 = read;
+
+		} else if (channel > first_step) {
 			diff = abs(read - prev_val_y);
 			if (diff < prev_diff_y) {
 				prev_diff_y = diff;
 				*y = read;
 			}
 			prev_val_y = read;
-
-		} else if (channel < creads * 2 + 1) {
-			*z1 = read;
-
-		} else if (channel < creads * 2 + 2) {
-			*z2 = read;
 		}
 	}
 }
-- 
1.9.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related

* [PATCH v3 0/6] Touchscreen performance related fixes
From: Vignesh R @ 2014-11-11  8:33 UTC (permalink / raw)
  To: Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala,
	Benoit Cousson, Tony Lindgren, Russell King, Jonathan Cameron,
	Hartmut Knaack, richardcochran, Dmitry Torokhov, Lee Jones,
	Sebastian Andrzej Siewior
  Cc: Lars-Peter Clausen, Peter Meerwald, Samuel Ortiz, Felipe Balbi,
	Vignesh R, Brad Griffis, Sanjeev Sharma, Paul Gortmaker,
	Jan Kardell, devicetree, linux-kernel, linux-omap,
	linux-arm-kernel, linux-iio, linux-input

This series of patches fix TSC defects related to lag in touchscreen
performance and cursor jump at touch release. The lag was result of
udelay in TSC interrupt handler. Cursor jump due to false pen-up event.
The patches implement Advisory 1.0.31 in silicon errata of am335x-evm
to avoid false pen-up events and remove udelay. The advisory says to use
steps 1 to 4 for ADC and 5 to 16 for TSC (assuming 4 wire TSC and 4 channel
ADC). Further the X co-ordinate must be the last one to be sampled just
before charge step. The first two patches implement the required changes.

A DT parameter to configure the duration of tsc charge step. It represents
number of ADC clock cycles to wait between applying the step configuration
registers and going back to the IDLE state. The charge delay value can vary
across boards. Configuring correct value of charge delay is important to avoid
false pen-up events. Hence it is necessary to expose charge-delay value as
DT parameter. The pen-up detection happens immediately after the charge step
so this does in fact function as a hardware knob for adjusting the amount of
settling time.

After applying these changes false pen-up events have not be observed and
smooth circles can be drawn on touch screen. The performance is much better
in recognizing quick movement across the screen. No lag or cursor jump is
observed.

Change log:

v3:
 - Replace delta filtering logic in TSC driver with median filtering
   as suggested by Richard.
 - Addressed Lee Jones comments.

v2:
 - Addressed comments by Hartmut Knaack
 - patch 2 was split into two as per Lee Jones comment

Brad Griffis (2):
  input: touchscreen: ti_am335x_tsc Interchange touchscreen and ADC
    steps
  input: touchscreen: ti_am335x_tsc: Remove udelay in interrupt handler

Vignesh R (4):
  mfd: ti_am335x_tscadc: Remove unwanted reg_se_cache save
  ARM: dts: AM335x: Make charge delay a DT parameter for tsc
  input: touchscreen: ti_am335x_tsc: Use charge delay DT parameter
  input: touchscreen: ti_am335x_tsc: Replace delta filtering with median
    filtering

 .../bindings/input/touchscreen/ti-tsc-adc.txt      |  15 ++
 arch/arm/boot/dts/am335x-evm.dts                   |   1 +
 drivers/iio/adc/ti_am335x_adc.c                    |   5 +-
 drivers/input/touchscreen/ti_am335x_tsc.c          | 179 +++++++++++----------
 drivers/mfd/ti_am335x_tscadc.c                     |   7 +-
 include/linux/mfd/ti_am335x_tscadc.h               |   4 +-
 6 files changed, 121 insertions(+), 90 deletions(-)

-- 
1.9.1

^ permalink raw reply

* Re: PROBLEM: Asus X751LA Touchpad not recognised
From: Mathias Gottschlag @ 2014-11-10 22:38 UTC (permalink / raw)
  To: Luca Manunta, linux-input
In-Reply-To: <CA+SCOPd=jQ5VU3gAKKVGWe_ggtyFpG5=gQ0yZF9WAdXZMYkPdw@mail.gmail.com>


This is very likely the same as:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1372609
https://bugzilla.redhat.com/show_bug.cgi?id=1110011

Maybe you can try the following kernel?
https://github.com/mgottschlag/linux/tree/focaltech2

I didn't have much time the last days and there is one report of suspend
failure in the second bug report above which I'd like to fix, although I
have no idea how.

Regards,
Mathias

Am 10.11.2014 um 23:13 schrieb Luca Manunta:
> [1.] One line summary of the problem:
> [Asus X751LA] Touchpad not recognised
>
> [2.] Full description of the problem/report:
> The touchpad is currently working as a PS/2 mouse, however this
> prevents from using synaptics/syndaemon to suspend touching while
> typing, and double finger scrolling. The only solution is to toggle
> the PS/2 mouse off and use an external mouse.
>
> [3.] Keywords: n/a
>
> [4.] Kernel version (from /proc/version):
> $ cat /proc/version
> Linux version 3.18.0-031800rc4-generic (apw@gomeisa) (gcc version
> 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) ) #201411091835 SMP Sun Nov 9
> 23:36:36 UTC 2014
>
> [5.] Output of Oops.. message: n/a
>
> [6.] A small shell script or example program which triggers the
> problem (if possible): n/a
>
> [7.] Environment
> $ lsb_release -rd
> Description:    Ubuntu 14.04.1 LTS
> Release:    14.04
>
> [7.1.] Software
> $ sh ver_linux
> If some fields are empty or look unusual you may have an old version.
> Compare to the current minimal requirements in Documentation/Changes.
>
> Linux bojanasus 3.18.0-031800rc4-generic #201411091835 SMP Sun Nov 9
> 23:36:36 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
>
> Gnu C                  4.8
> Gnu make               3.81
> binutils               2.24
> util-linux             2.20.1
> mount                  support
> module-init-tools      15
> e2fsprogs              1.42.9
> pcmciautils            018
> Linux C Library        2.19
> Dynamic linker (ldd)   2.19
> Procps                 3.3.9
> Net-tools              1.60
> Kbd                    1.15.5
> Sh-utils               8.21
> wireless-tools         30
> Modules Loaded         ctr ccm bnep rfcomm binfmt_misc nls_iso8859_1
> intel_rapl x86_pkg_temp_thermal intel_powerclamp coretemp kvm_intel
> kvm crct10dif_pclmul crc32_pclmul ghash_clmulni_intel aesni_intel
> aes_x86_64 lrw gf128mul arc4 glue_helper uvcvideo ablk_helper ath9k
> videobuf2_vmalloc cryptd videobuf2_memops ath9k_common ath9k_hw
> videobuf2_core ath v4l2_common videodev mac80211 cfg80211 asus_nb_wmi
> snd_hda_codec_hdmi asus_wmi media joydev sparse_keymap serio_raw
> pcspkr snd_hda_codec_realtek snd_hda_codec_generic i915 parport_pc
> ppdev snd_hda_intel drm_kms_helper snd_soc_rt5640 lpc_ich btusb
> snd_hda_controller snd_soc_rl6231 i2c_hid snd_soc_core snd_hda_codec
> bluetooth snd_hwdep lp snd_seq_midi int3400_thermal dw_dmac
> snd_compress video dw_dmac_core mei_me snd_pcm_dmaengine snd_pcm
> int3402_thermal acpi_thermal_rel drm mei rtsx_pci_ms wmi memstick
> i2c_algo_bit i2c_designware_platform snd_seq_midi_event
> i2c_designware_core snd_rawmidi snd_seq parport spi_pxa2xx_platform
> mac_hid snd_seq_device snd_timer snd soundcore snd_soc_sst_acpi
> 8250_dw hid_generic usbhid hid rtsx_pci_sdmmc r8169 mii psmouse ahci
> libahci rtsx_pci sdhci_acpi sdhci
>
>
> [7.2.] Processor information
> $ cat /proc/cpuinfo
> processor    : 0
> vendor_id    : GenuineIntel
> cpu family    : 6
> model        : 69
> model name    : Intel(R) Core(TM) i7-4500U CPU @ 1.80GHz
> stepping    : 1
> microcode    : 0x15
> cpu MHz        : 1800.000
> cache size    : 4096 KB
> physical id    : 0
> siblings    : 4
> core id        : 0
> cpu cores    : 2
> apicid        : 0
> initial apicid    : 0
> fpu        : yes
> fpu_exception    : yes
> cpuid level    : 13
> wp        : yes
> flags        : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge
> mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe
> syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts
> rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq
> dtes64 monitor ds_cpl vmx est tm2 ssse3 fma cx16 xtpr pdcm pcid sse4_1
> sse4_2 movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand
> lahf_lm abm ida arat epb pln pts dtherm tpr_shadow vnmi flexpriority
> ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid xsaveopt
> bugs        :
> bogomips    : 4793.19
> clflush size    : 64
> cache_alignment    : 64
> address sizes    : 39 bits physical, 48 bits virtual
> power management:
>
> processor    : 1
> vendor_id    : GenuineIntel
> cpu family    : 6
> model        : 69
> model name    : Intel(R) Core(TM) i7-4500U CPU @ 1.80GHz
> stepping    : 1
> microcode    : 0x15
> cpu MHz        : 1800.000
> cache size    : 4096 KB
> physical id    : 0
> siblings    : 4
> core id        : 1
> cpu cores    : 2
> apicid        : 2
> initial apicid    : 2
> fpu        : yes
> fpu_exception    : yes
> cpuid level    : 13
> wp        : yes
> flags        : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge
> mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe
> syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts
> rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq
> dtes64 monitor ds_cpl vmx est tm2 ssse3 fma cx16 xtpr pdcm pcid sse4_1
> sse4_2 movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand
> lahf_lm abm ida arat epb pln pts dtherm tpr_shadow vnmi flexpriority
> ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid xsaveopt
> bugs        :
> bogomips    : 4793.19
> clflush size    : 64
> cache_alignment    : 64
> address sizes    : 39 bits physical, 48 bits virtual
> power management:
>
> processor    : 2
> vendor_id    : GenuineIntel
> cpu family    : 6
> model        : 69
> model name    : Intel(R) Core(TM) i7-4500U CPU @ 1.80GHz
> stepping    : 1
> microcode    : 0x15
> cpu MHz        : 1803.750
> cache size    : 4096 KB
> physical id    : 0
> siblings    : 4
> core id        : 0
> cpu cores    : 2
> apicid        : 1
> initial apicid    : 1
> fpu        : yes
> fpu_exception    : yes
> cpuid level    : 13
> wp        : yes
> flags        : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge
> mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe
> syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts
> rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq
> dtes64 monitor ds_cpl vmx est tm2 ssse3 fma cx16 xtpr pdcm pcid sse4_1
> sse4_2 movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand
> lahf_lm abm ida arat epb pln pts dtherm tpr_shadow vnmi flexpriority
> ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid xsaveopt
> bugs        :
> bogomips    : 4793.19
> clflush size    : 64
> cache_alignment    : 64
> address sizes    : 39 bits physical, 48 bits virtual
> power management:
>
> processor    : 3
> vendor_id    : GenuineIntel
> cpu family    : 6
> model        : 69
> model name    : Intel(R) Core(TM) i7-4500U CPU @ 1.80GHz
> stepping    : 1
> microcode    : 0x15
> cpu MHz        : 1803.000
> cache size    : 4096 KB
> physical id    : 0
> siblings    : 4
> core id        : 1
> cpu cores    : 2
> apicid        : 3
> initial apicid    : 3
> fpu        : yes
> fpu_exception    : yes
> cpuid level    : 13
> wp        : yes
> flags        : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge
> mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe
> syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts
> rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq
> dtes64 monitor ds_cpl vmx est tm2 ssse3 fma cx16 xtpr pdcm pcid sse4_1
> sse4_2 movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand
> lahf_lm abm ida arat epb pln pts dtherm tpr_shadow vnmi flexpriority
> ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid xsaveopt
> bugs        :
> bogomips    : 4793.19
> clflush size    : 64
> cache_alignment    : 64
> address sizes    : 39 bits physical, 48 bits virtual
> power management:
>
> [7.3.] Module information
> $ cat /proc/modules
> ctr 13193 1 - Live 0x0000000000000000
> ccm 17856 1 - Live 0x0000000000000000
> bnep 23980 2 - Live 0x0000000000000000
> rfcomm 75066 12 - Live 0x0000000000000000
> binfmt_misc 17501 1 - Live 0x0000000000000000
> nls_iso8859_1 12713 1 - Live 0x0000000000000000
> intel_rapl 19196 0 - Live 0x0000000000000000
> x86_pkg_temp_thermal 14312 0 - Live 0x0000000000000000
> intel_powerclamp 19099 0 - Live 0x0000000000000000
> coretemp 13638 0 - Live 0x0000000000000000
> kvm_intel 149984 0 - Live 0x0000000000000000
> kvm 475233 1 kvm_intel, Live 0x0000000000000000
> crct10dif_pclmul 14268 0 - Live 0x0000000000000000
> crc32_pclmul 13180 0 - Live 0x0000000000000000
> ghash_clmulni_intel 13230 0 - Live 0x0000000000000000
> aesni_intel 169686 2 - Live 0x0000000000000000
> aes_x86_64 17131 1 aesni_intel, Live 0x0000000000000000
> lrw 13323 1 aesni_intel, Live 0x0000000000000000
> gf128mul 14951 1 lrw, Live 0x0000000000000000
> arc4 12573 2 - Live 0x0000000000000000
> glue_helper 14095 1 aesni_intel, Live 0x0000000000000000
> uvcvideo 86723 0 - Live 0x0000000000000000
> ablk_helper 13597 1 aesni_intel, Live 0x0000000000000000
> ath9k 162133 0 - Live 0x0000000000000000
> videobuf2_vmalloc 13216 1 uvcvideo, Live 0x0000000000000000
> cryptd 20531 3 ghash_clmulni_intel,aesni_intel,ablk_helper, Live
> 0x0000000000000000
> videobuf2_memops 13362 1 videobuf2_vmalloc, Live 0x0000000000000000
> ath9k_common 25638 1 ath9k, Live 0x0000000000000000
> ath9k_hw 460416 2 ath9k,ath9k_common, Live 0x0000000000000000
> videobuf2_core 51547 1 uvcvideo, Live 0x0000000000000000
> ath 29397 3 ath9k,ath9k_common,ath9k_hw, Live 0x0000000000000000
> v4l2_common 15715 1 videobuf2_core, Live 0x0000000000000000
> videodev 163831 3 uvcvideo,videobuf2_core,v4l2_common, Live 0x0000000000000000
> mac80211 697143 1 ath9k, Live 0x0000000000000000
> cfg80211 520257 4 ath9k,ath9k_common,ath,mac80211, Live 0x0000000000000000
> asus_nb_wmi 21128 0 - Live 0x0000000000000000
> snd_hda_codec_hdmi 52670 1 - Live 0x0000000000000000
> asus_wmi 24697 1 asus_nb_wmi, Live 0x0000000000000000
> media 22008 2 uvcvideo,videodev, Live 0x0000000000000000
> joydev 17587 0 - Live 0x0000000000000000
> sparse_keymap 13890 1 asus_wmi, Live 0x0000000000000000
> serio_raw 13483 0 - Live 0x0000000000000000
> pcspkr 12718 0 - Live 0x0000000000000000
> snd_hda_codec_realtek 80418 1 - Live 0x0000000000000000
> snd_hda_codec_generic 69995 1 snd_hda_codec_realtek, Live 0x0000000000000000
> i915 1031913 9 - Live 0x0000000000000000
> parport_pc 32909 0 - Live 0x0000000000000000
> ppdev 17711 0 - Live 0x0000000000000000
> snd_hda_intel 30783 17 - Live 0x0000000000000000
> drm_kms_helper 99802 1 i915, Live 0x0000000000000000
> snd_soc_rt5640 93325 0 - Live 0x0000000000000000
> lpc_ich 21176 0 - Live 0x0000000000000000
> btusb 32691 0 - Live 0x0000000000000000
> snd_hda_controller 32234 1 snd_hda_intel, Live 0x0000000000000000
> snd_soc_rl6231 13037 1 snd_soc_rt5640, Live 0x0000000000000000
> i2c_hid 19065 0 - Live 0x0000000000000000
> snd_soc_core 207596 1 snd_soc_rt5640, Live 0x0000000000000000
> snd_hda_codec 144641 5
> snd_hda_codec_hdmi,snd_hda_codec_realtek,snd_hda_codec_generic,snd_hda_intel,snd_hda_controller,
> Live 0x0000000000000000
> bluetooth 486890 22 bnep,rfcomm,btusb, Live 0x0000000000000000
> snd_hwdep 17709 1 snd_hda_codec, Live 0x0000000000000000
> lp 17799 0 - Live 0x0000000000000000
> snd_seq_midi 13564 0 - Live 0x0000000000000000
> int3400_thermal 13040 0 - Live 0x0000000000000000
> dw_dmac 12835 0 - Live 0x0000000000000000
> snd_compress 19395 1 snd_soc_core, Live 0x0000000000000000
> video 20649 2 asus_wmi,i915, Live 0x0000000000000000
> dw_dmac_core 28558 1 dw_dmac, Live 0x0000000000000000
> mei_me 19565 0 - Live 0x0000000000000000
> snd_pcm_dmaengine 15229 1 snd_soc_core, Live 0x0000000000000000
> snd_pcm 106273 8
> snd_hda_codec_hdmi,snd_hda_intel,snd_soc_rt5640,snd_hda_controller,snd_soc_core,snd_hda_codec,snd_pcm_dmaengine,
> Live 0x0000000000000000
> int3402_thermal 13060 0 - Live 0x0000000000000000
> acpi_thermal_rel 13807 1 int3400_thermal, Live 0x0000000000000000
> drm 323675 8 i915,drm_kms_helper, Live 0x0000000000000000
> mei 88473 1 mei_me, Live 0x0000000000000000
> rtsx_pci_ms 18337 0 - Live 0x0000000000000000
> wmi 19379 1 asus_wmi, Live 0x0000000000000000
> memstick 16968 1 rtsx_pci_ms, Live 0x0000000000000000
> i2c_algo_bit 13564 1 i915, Live 0x0000000000000000
> i2c_designware_platform 13025 0 - Live 0x0000000000000000
> snd_seq_midi_event 14899 1 snd_seq_midi, Live 0x0000000000000000
> i2c_designware_core 14990 1 i2c_designware_platform, Live 0x0000000000000000
> snd_rawmidi 31197 1 snd_seq_midi, Live 0x0000000000000000
> snd_seq 63540 2 snd_seq_midi,snd_seq_midi_event, Live 0x0000000000000000
> parport 42481 3 parport_pc,ppdev,lp, Live 0x0000000000000000
> spi_pxa2xx_platform 23256 0 - Live 0x0000000000000000
> mac_hid 13275 0 - Live 0x0000000000000000
> snd_seq_device 14497 3 snd_seq_midi,snd_rawmidi,snd_seq, Live 0x0000000000000000
> snd_timer 30118 2 snd_pcm,snd_seq, Live 0x0000000000000000
> snd 84025 46 snd_hda_codec_hdmi,snd_hda_codec_realtek,snd_hda_codec_generic,snd_hda_intel,snd_soc_core,snd_hda_codec,snd_hwdep,snd_compress,snd_pcm,snd_rawmidi,snd_seq,snd_seq_device,snd_timer,
> Live 0x0000000000000000
> soundcore 15091 2 snd_hda_codec,snd, Live 0x0000000000000000
> snd_soc_sst_acpi 13007 0 - Live 0x0000000000000000
> 8250_dw 13474 0 - Live 0x0000000000000000
> hid_generic 12559 0 - Live 0x0000000000000000
> usbhid 53155 0 - Live 0x0000000000000000
> hid 110572 4 i2c_hid,hid_generic,usbhid, Live 0x0000000000000000
> rtsx_pci_sdmmc 23718 0 - Live 0x0000000000000000
> r8169 86907 0 - Live 0x0000000000000000
> mii 13981 1 r8169, Live 0x0000000000000000
> psmouse 118117 0 - Live 0x0000000000000000
> ahci 34220 3 - Live 0x0000000000000000
> libahci 32446 1 ahci, Live 0x0000000000000000
> rtsx_pci 51162 2 rtsx_pci_ms,rtsx_pci_sdmmc, Live 0x0000000000000000
> sdhci_acpi 13502 0 - Live 0x0000000000000000
> sdhci 43929 1 sdhci_acpi, Live 0x0000000000000000
>
> [7.4.] Loaded driver and hardware information
>  cat /proc/ioports
> 0000-0cf7 : PCI Bus 0000:00
>   0000-001f : dma1
>   0020-0021 : pic1
>   0040-0043 : timer0
>   0050-0053 : timer1
>   0060-0060 : keyboard
>   0062-0062 : PNP0C09:00
>     0062-0062 : EC data
>   0064-0064 : keyboard
>   0066-0066 : PNP0C09:00
>     0066-0066 : EC cmd
>   0070-0077 : rtc0
>   0080-008f : dma page reg
>   00a0-00a1 : pic2
>   00c0-00df : dma2
>   00f0-00ff : fpu
>   0240-0259 : pnp 00:05
>   04d0-04d1 : pnp 00:04
>   0680-069f : pnp 00:01
> 0cf8-0cff : PCI conf1
> 0d00-ffff : PCI Bus 0000:00
>   164e-164f : pnp 00:01
>   1800-1803 : ACPI PM1a_EVT_BLK
>   1804-1805 : ACPI PM1a_CNT_BLK
>   1808-180b : ACPI PM_TMR
>   1810-1815 : ACPI CPU throttle
>   1830-1833 : iTCO_wdt
>   1850-1850 : ACPI PM2_CNT_BLK
>   1854-1857 : pnp 00:03
>   1860-187f : iTCO_wdt
>   1880-189f : ACPI GPE0_BLK
>   1c00-1cfe : pnp 00:01
>   1d00-1dfe : pnp 00:01
>   1e00-1efe : pnp 00:01
>   1f00-1ffe : pnp 00:01
>   e000-efff : PCI Bus 0000:02
>     e000-e0ff : 0000:02:00.1
>       e000-e0ff : r8169
>   f000-f03f : 0000:00:02.0
>   f040-f05f : 0000:00:1f.3
>   f060-f07f : 0000:00:1f.2
>     f060-f07f : ahci
>   f080-f083 : 0000:00:1f.2
>     f080-f083 : ahci
>   f090-f097 : 0000:00:1f.2
>     f090-f097 : ahci
>   f0a0-f0a3 : 0000:00:1f.2
>     f0a0-f0a3 : ahci
>   f0b0-f0b7 : 0000:00:1f.2
>     f0b0-f0b7 : ahci
>   ffff-ffff : pnp 00:01
>     ffff-ffff : pnp 00:01
>       ffff-ffff : pnp 00:01
>
> $ cat /proc/iomem
> 00000000-00000fff : reserved
> 00001000-00057fff : System RAM
> 00058000-00058fff : reserved
> 00059000-0009efff : System RAM
> 0009f000-0009ffff : reserved
> 000a0000-000bffff : PCI Bus 0000:00
> 000c0000-000cebff : Video ROM
> 000d0000-000d3fff : PCI Bus 0000:00
> 000d4000-000d7fff : PCI Bus 0000:00
> 000d8000-000dbfff : PCI Bus 0000:00
> 000dc000-000dffff : PCI Bus 0000:00
> 000f0000-000fffff : System ROM
> 00100000-c9b27fff : System RAM
>   02000000-027b1c17 : Kernel code
>   027b1c18-02d19c7f : Kernel data
>   02e80000-02fc8fff : Kernel bss
> c9b28000-c9b2efff : ACPI Non-volatile Storage
> c9b2f000-ca365fff : System RAM
> ca366000-ca5cdfff : reserved
> ca5ce000-d993dfff : System RAM
> d993e000-d9b45fff : reserved
> d9b46000-d9e82fff : System RAM
> d9e83000-dab4cfff : ACPI Non-volatile Storage
> dab4d000-daf59fff : reserved
> daf5a000-daffefff : reserved
> dafff000-daffffff : System RAM
> db000000-dbbfffff : RAM buffer
> dbc00000-dfdfffff : reserved
>   dbe00000-dfdfffff : Graphics Stolen Memory
> dfe00000-feafffff : PCI Bus 0000:00
>   e0000000-efffffff : 0000:00:02.0
>   f7800000-f7bfffff : 0000:00:02.0
>   f7c00000-f7cfffff : PCI Bus 0000:03
>     f7c00000-f7c7ffff : 0000:03:00.0
>       f7c00000-f7c7ffff : ath9k
>     f7c80000-f7c8ffff : 0000:03:00.0
>   f7d00000-f7dfffff : PCI Bus 0000:02
>     f7d00000-f7d0ffff : 0000:02:00.0
>     f7d10000-f7d13fff : 0000:02:00.1
>       f7d10000-f7d13fff : r8169
>     f7d14000-f7d14fff : 0000:02:00.1
>       f7d14000-f7d14fff : r8169
>     f7d15000-f7d15fff : 0000:02:00.0
>       f7d15000-f7d15fff : rtsx_pci
>   f7e00000-f7e0ffff : 0000:00:14.0
>     f7e00000-f7e0ffff : xhci-hcd
>   f7e10000-f7e17fff : 0000:00:04.0
>   f7e18000-f7e1bfff : 0000:00:1b.0
>     f7e18000-f7e1bfff : ICH HD audio
>   f7e1c000-f7e1ffff : 0000:00:03.0
>     f7e1c000-f7e1ffff : ICH HD audio
>   f7e20000-f7e20fff : 0000:00:1f.6
>   f7e21000-f7e210ff : 0000:00:1f.3
>   f7e22000-f7e227ff : 0000:00:1f.2
>     f7e22000-f7e227ff : ahci
>   f7e23000-f7e233ff : 0000:00:1d.0
>     f7e23000-f7e233ff : ehci_hcd
>   f7e25000-f7e2501f : 0000:00:16.0
>     f7e25000-f7e2501f : mei_me
>   f7fdf000-f7fdffff : pnp 00:09
>   f7fe0000-f7feffff : pnp 00:09
>   f8000000-fbffffff : PCI MMCONFIG 0000 [bus 00-3f]
>     f8000000-fbffffff : reserved
>       f8000000-fbffffff : pnp 00:09
> fec00000-fec00fff : reserved
>   fec00000-fec003ff : IOAPIC 0
> fed00000-fed03fff : reserved
>   fed00000-fed003ff : HPET 0
>     fed00000-fed003ff : PNP0103:00
> fed10000-fed17fff : pnp 00:09
> fed18000-fed18fff : pnp 00:09
> fed19000-fed19fff : pnp 00:09
> fed1c000-fed1ffff : reserved
>   fed1c000-fed1ffff : pnp 00:09
>     fed1f410-fed1f414 : iTCO_wdt
> fed20000-fed3ffff : pnp 00:09
> fed40000-fed44fff : pnp 00:00
> fed45000-fed8ffff : pnp 00:09
> fed90000-fed93fff : pnp 00:09
> fee00000-fee00fff : Local APIC
>   fee00000-fee00fff : reserved
> ff000000-ffffffff : reserved
>   ff000000-ffffffff : INT0800:00
>     ff000000-ffffffff : pnp 00:09
> 100000000-21f1fffff : System RAM
> 21f200000-21fffffff : RAM buffer
>
> [7.5.] PCI information
> $ sudo lspci -vvv
> [sudo] password for luca:
> 00:00.0 Host bridge: Intel Corporation Haswell-ULT DRAM Controller (rev 09)
>     Subsystem: ASUSTeK Computer Inc. Device 15ad
>     Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
> ParErr- Stepping- SERR- FastB2B- DisINTx-
>     Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=fast >TAbort-
> <TAbort- <MAbort+ >SERR- <PERR- INTx-
>     Latency: 0
>     Capabilities: [e0] Vendor Specific Information: Len=0c <?>
>
> 00:02.0 VGA compatible controller: Intel Corporation Haswell-ULT
> Integrated Graphics Controller (rev 09) (prog-if 00 [VGA controller])
>     Subsystem: ASUSTeK Computer Inc. Device 15ad
>     Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
> ParErr- Stepping- SERR- FastB2B- DisINTx+
>     Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=fast >TAbort-
> <TAbort- <MAbort- >SERR- <PERR- INTx-
>     Latency: 0
>     Interrupt: pin A routed to IRQ 46
>     Region 0: Memory at f7800000 (64-bit, non-prefetchable) [size=4M]
>     Region 2: Memory at e0000000 (64-bit, prefetchable) [size=256M]
>     Region 4: I/O ports at f000 [size=64]
>     Expansion ROM at <unassigned> [disabled]
>     Capabilities: [90] MSI: Enable+ Count=1/1 Maskable- 64bit-
>         Address: fee0f00c  Data: 4152
>     Capabilities: [d0] Power Management version 2
>         Flags: PMEClk- DSI+ D1- D2- AuxCurrent=0mA
> PME(D0-,D1-,D2-,D3hot-,D3cold-)
>         Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
>     Capabilities: [a4] PCI Advanced Features
>         AFCap: TP+ FLR+
>         AFCtrl: FLR-
>         AFStatus: TP-
>     Kernel driver in use: i915
>
> 00:03.0 Audio device: Intel Corporation Haswell-ULT HD Audio Controller (rev 09)
>     Subsystem: ASUSTeK Computer Inc. Device 15ad
>     Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
> ParErr- Stepping- SERR- FastB2B- DisINTx+
>     Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort-
> <TAbort- <MAbort- >SERR- <PERR- INTx-
>     Latency: 0, Cache Line Size: 64 bytes
>     Interrupt: pin A routed to IRQ 47
>     Region 0: Memory at f7e1c000 (64-bit, non-prefetchable) [size=16K]
>     Capabilities: [50] Power Management version 2
>         Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA
> PME(D0-,D1-,D2-,D3hot-,D3cold-)
>         Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
>     Capabilities: [60] MSI: Enable+ Count=1/1 Maskable- 64bit-
>         Address: fee0f00c  Data: 4162
>     Capabilities: [70] Express (v1) Root Complex Integrated Endpoint, MSI 00
>         DevCap:    MaxPayload 128 bytes, PhantFunc 0
>             ExtTag- RBE-
>         DevCtl:    Report errors: Correctable- Non-Fatal- Fatal- Unsupported-
>             RlxdOrd- ExtTag- PhantFunc- AuxPwr- NoSnoop-
>             MaxPayload 128 bytes, MaxReadReq 128 bytes
>         DevSta:    CorrErr- UncorrErr- FatalErr- UnsuppReq- AuxPwr- TransPend-
>     Kernel driver in use: snd_hda_intel
>
> 00:04.0 Signal processing controller: Intel Corporation Device 0a03 (rev 09)
>     Subsystem: Intel Corporation Device 2010
>     Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
> ParErr- Stepping- SERR- FastB2B- DisINTx-
>     Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=fast >TAbort-
> <TAbort- <MAbort- >SERR- <PERR- INTx-
>     Latency: 0
>     Interrupt: pin A routed to IRQ 11
>     Region 0: Memory at f7e10000 (64-bit, non-prefetchable) [size=32K]
>     Capabilities: [90] MSI: Enable- Count=1/1 Maskable- 64bit-
>         Address: 00000000  Data: 0000
>     Capabilities: [d0] Power Management version 3
>         Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA
> PME(D0-,D1-,D2-,D3hot-,D3cold-)
>         Status: D0 NoSoftRst+ PME-Enable- DSel=0 DScale=0 PME-
>     Capabilities: [e0] Vendor Specific Information: Len=0c <?>
>
> 00:14.0 USB controller: Intel Corporation Lynx Point-LP USB xHCI HC
> (rev 04) (prog-if 30 [XHCI])
>     Subsystem: ASUSTeK Computer Inc. Device 201f
>     Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
> ParErr- Stepping- SERR- FastB2B- DisINTx+
>     Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort-
> <TAbort- <MAbort- >SERR- <PERR- INTx-
>     Latency: 0
>     Interrupt: pin A routed to IRQ 40
>     Region 0: Memory at f7e00000 (64-bit, non-prefetchable) [size=64K]
>     Capabilities: [70] Power Management version 2
>         Flags: PMEClk- DSI- D1- D2- AuxCurrent=375mA
> PME(D0-,D1-,D2-,D3hot+,D3cold+)
>         Status: D0 NoSoftRst+ PME-Enable- DSel=0 DScale=0 PME-
>     Capabilities: [80] MSI: Enable+ Count=1/8 Maskable- 64bit+
>         Address: 00000000fee0a00c  Data: 4191
>     Kernel driver in use: xhci_hcd
>
> 00:16.0 Communication controller: Intel Corporation Lynx Point-LP HECI
> #0 (rev 04)
>     Subsystem: ASUSTeK Computer Inc. Device 15ad
>     Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
> ParErr- Stepping- SERR- FastB2B- DisINTx+
>     Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort-
> <TAbort- <MAbort- >SERR- <PERR- INTx-
>     Latency: 0
>     Interrupt: pin A routed to IRQ 44
>     Region 0: Memory at f7e25000 (64-bit, non-prefetchable) [size=32]
>     Capabilities: [50] Power Management version 3
>         Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA
> PME(D0+,D1-,D2-,D3hot+,D3cold+)
>         Status: D0 NoSoftRst+ PME-Enable- DSel=0 DScale=0 PME-
>     Capabilities: [8c] MSI: Enable+ Count=1/1 Maskable- 64bit+
>         Address: 00000000fee0f00c  Data: 41e1
>     Kernel driver in use: mei_me
>
> 00:1b.0 Audio device: Intel Corporation Lynx Point-LP HD Audio
> Controller (rev 04)
>     Subsystem: ASUSTeK Computer Inc. Device 15ad
>     Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
> ParErr- Stepping- SERR- FastB2B- DisINTx+
>     Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort-
> <TAbort- <MAbort- >SERR- <PERR- INTx-
>     Latency: 0, Cache Line Size: 64 bytes
>     Interrupt: pin A routed to IRQ 45
>     Region 0: Memory at f7e18000 (64-bit, non-prefetchable) [size=16K]
>     Capabilities: [50] Power Management version 3
>         Flags: PMEClk- DSI- D1- D2- AuxCurrent=55mA
> PME(D0+,D1-,D2-,D3hot+,D3cold+)
>         Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
>     Capabilities: [60] MSI: Enable+ Count=1/1 Maskable- 64bit+
>         Address: 00000000fee0f00c  Data: 4142
>     Capabilities: [70] Express (v1) Root Complex Integrated Endpoint, MSI 00
>         DevCap:    MaxPayload 128 bytes, PhantFunc 0
>             ExtTag- RBE-
>         DevCtl:    Report errors: Correctable- Non-Fatal- Fatal- Unsupported-
>             RlxdOrd- ExtTag- PhantFunc- AuxPwr- NoSnoop-
>             MaxPayload 128 bytes, MaxReadReq 128 bytes
>         DevSta:    CorrErr- UncorrErr- FatalErr- UnsuppReq- AuxPwr+ TransPend-
>     Capabilities: [100 v1] Virtual Channel
>         Caps:    LPEVC=0 RefClk=100ns PATEntryBits=1
>         Arb:    Fixed- WRR32- WRR64- WRR128-
>         Ctrl:    ArbSelect=Fixed
>         Status:    InProgress-
>         VC0:    Caps:    PATOffset=00 MaxTimeSlots=1 RejSnoopTrans-
>             Arb:    Fixed- WRR32- WRR64- WRR128- TWRR128- WRR256-
>             Ctrl:    Enable+ ID=0 ArbSelect=Fixed TC/VC=01
>             Status:    NegoPending- InProgress-
>         VC1:    Caps:    PATOffset=00 MaxTimeSlots=1 RejSnoopTrans-
>             Arb:    Fixed- WRR32- WRR64- WRR128- TWRR128- WRR256-
>             Ctrl:    Enable- ID=2 ArbSelect=Fixed TC/VC=04
>             Status:    NegoPending- InProgress-
>     Kernel driver in use: snd_hda_intel
>
> 00:1c.0 PCI bridge: Intel Corporation Lynx Point-LP PCI Express Root
> Port 1 (rev e4) (prog-if 00 [Normal decode])
>     Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
> ParErr- Stepping- SERR- FastB2B- DisINTx-
>     Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort-
> <TAbort- <MAbort- >SERR- <PERR- INTx-
>     Latency: 0, Cache Line Size: 64 bytes
>     Bus: primary=00, secondary=01, subordinate=01, sec-latency=0
>     I/O behind bridge: 0000f000-00000fff
>     Memory behind bridge: fff00000-000fffff
>     Prefetchable memory behind bridge: 00000000fff00000-00000000000fffff
>     Secondary status: 66MHz- FastB2B- ParErr- DEVSEL=fast >TAbort-
> <TAbort- <MAbort+ <SERR- <PERR-
>     BridgeCtl: Parity- SERR- NoISA- VGA- MAbort- >Reset- FastB2B-
>         PriDiscTmr- SecDiscTmr- DiscTmrStat- DiscTmrSERREn-
>     Capabilities: [40] Express (v2) Root Port (Slot-), MSI 00
>         DevCap:    MaxPayload 128 bytes, PhantFunc 0
>             ExtTag- RBE+
>         DevCtl:    Report errors: Correctable- Non-Fatal- Fatal- Unsupported-
>             RlxdOrd- ExtTag- PhantFunc- AuxPwr- NoSnoop-
>             MaxPayload 128 bytes, MaxReadReq 128 bytes
>         DevSta:    CorrErr- UncorrErr- FatalErr- UnsuppReq- AuxPwr+ TransPend-
>         LnkCap:    Port #1, Speed 5GT/s, Width x1, ASPM L0s L1, Exit
> Latency L0s <1us, L1 <4us
>             ClockPM- Surprise- LLActRep+ BwNot+
>         LnkCtl:    ASPM L0s L1 Enabled; RCB 64 bytes Disabled- CommClk-
>             ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
>         LnkSta:    Speed 2.5GT/s, Width x0, TrErr- Train- SlotClk+
> DLActive- BWMgmt- ABWMgmt-
>         RootCtl: ErrCorrectable- ErrNon-Fatal- ErrFatal- PMEIntEna- CRSVisible-
>         RootCap: CRSVisible-
>         RootSta: PME ReqID 0000, PMEStatus- PMEPending-
>         DevCap2: Completion Timeout: Range ABC, TimeoutDis+, LTR+,
> OBFF Via WAKE# ARIFwd-
>         DevCtl2: Completion Timeout: 50us to 50ms, TimeoutDis-, LTR+,
> OBFF Disabled ARIFwd-
>         LnkCtl2: Target Link Speed: 5GT/s, EnterCompliance- SpeedDis-
>              Transmit Margin: Normal Operating Range,
> EnterModifiedCompliance- ComplianceSOS-
>              Compliance De-emphasis: -6dB
>         LnkSta2: Current De-emphasis Level: -3.5dB,
> EqualizationComplete-, EqualizationPhase1-
>              EqualizationPhase2-, EqualizationPhase3-, LinkEqualizationRequest-
>     Capabilities: [80] MSI: Enable- Count=1/1 Maskable- 64bit-
>         Address: 00000000  Data: 0000
>     Capabilities: [90] Subsystem: ASUSTeK Computer Inc. Device 15ad
>     Capabilities: [a0] Power Management version 3
>         Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA
> PME(D0+,D1-,D2-,D3hot+,D3cold+)
>         Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
>     Kernel driver in use: pcieport
>
> 00:1c.2 PCI bridge: Intel Corporation Lynx Point-LP PCI Express Root
> Port 3 (rev e4) (prog-if 00 [Normal decode])
>     Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
> ParErr- Stepping- SERR- FastB2B- DisINTx-
>     Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort-
> <TAbort- <MAbort- >SERR- <PERR- INTx-
>     Latency: 0, Cache Line Size: 64 bytes
>     Bus: primary=00, secondary=02, subordinate=02, sec-latency=0
>     I/O behind bridge: 0000e000-0000efff
>     Memory behind bridge: f7d00000-f7dfffff
>     Prefetchable memory behind bridge: 00000000fff00000-00000000000fffff
>     Secondary status: 66MHz- FastB2B- ParErr- DEVSEL=fast >TAbort-
> <TAbort- <MAbort+ <SERR- <PERR-
>     BridgeCtl: Parity- SERR- NoISA- VGA- MAbort- >Reset- FastB2B-
>         PriDiscTmr- SecDiscTmr- DiscTmrStat- DiscTmrSERREn-
>     Capabilities: [40] Express (v2) Root Port (Slot+), MSI 00
>         DevCap:    MaxPayload 128 bytes, PhantFunc 0
>             ExtTag- RBE+
>         DevCtl:    Report errors: Correctable- Non-Fatal- Fatal- Unsupported-
>             RlxdOrd- ExtTag- PhantFunc- AuxPwr- NoSnoop-
>             MaxPayload 128 bytes, MaxReadReq 128 bytes
>         DevSta:    CorrErr- UncorrErr- FatalErr- UnsuppReq- AuxPwr+ TransPend-
>         LnkCap:    Port #3, Speed 5GT/s, Width x1, ASPM L0s L1, Exit
> Latency L0s <512ns, L1 <16us
>             ClockPM- Surprise- LLActRep+ BwNot+
>         LnkCtl:    ASPM Disabled; RCB 64 bytes Disabled- CommClk+
>             ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
>         LnkSta:    Speed 2.5GT/s, Width x1, TrErr- Train- SlotClk+
> DLActive+ BWMgmt+ ABWMgmt-
>         SltCap:    AttnBtn- PwrCtrl- MRL- AttnInd- PwrInd- HotPlug- Surprise-
>             Slot #2, PowerLimit 10.000W; Interlock- NoCompl+
>         SltCtl:    Enable: AttnBtn- PwrFlt- MRL- PresDet- CmdCplt-
> HPIrq- LinkChg-
>             Control: AttnInd Unknown, PwrInd Unknown, Power- Interlock-
>         SltSta:    Status: AttnBtn- PowerFlt- MRL- CmdCplt- PresDet+ Interlock-
>             Changed: MRL- PresDet- LinkState-
>         RootCtl: ErrCorrectable- ErrNon-Fatal- ErrFatal- PMEIntEna- CRSVisible-
>         RootCap: CRSVisible-
>         RootSta: PME ReqID 0000, PMEStatus- PMEPending-
>         DevCap2: Completion Timeout: Range ABC, TimeoutDis+, LTR+,
> OBFF Not Supported ARIFwd-
>         DevCtl2: Completion Timeout: 50us to 50ms, TimeoutDis-, LTR+,
> OBFF Disabled ARIFwd-
>         LnkCtl2: Target Link Speed: 5GT/s, EnterCompliance- SpeedDis-
>              Transmit Margin: Normal Operating Range,
> EnterModifiedCompliance- ComplianceSOS-
>              Compliance De-emphasis: -6dB
>         LnkSta2: Current De-emphasis Level: -3.5dB,
> EqualizationComplete-, EqualizationPhase1-
>              EqualizationPhase2-, EqualizationPhase3-, LinkEqualizationRequest-
>     Capabilities: [80] MSI: Enable- Count=1/1 Maskable- 64bit-
>         Address: 00000000  Data: 0000
>     Capabilities: [90] Subsystem: ASUSTeK Computer Inc. Device 15ad
>     Capabilities: [a0] Power Management version 3
>         Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA
> PME(D0+,D1-,D2-,D3hot+,D3cold+)
>         Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
>     Capabilities: [100 v0] #00
>     Capabilities: [200 v1] L1 PM Substates
>         L1SubCap: PCI-PM_L1.2+ PCI-PM_L1.1+ ASPM_L1.2+ ASPM_L1.1+
> L1_PM_Substates+
>               PortCommonModeRestoreTime=40us PortTPowerOnTime=10us
>     Kernel driver in use: pcieport
>
> 00:1c.3 PCI bridge: Intel Corporation Lynx Point-LP PCI Express Root
> Port 4 (rev e4) (prog-if 00 [Normal decode])
>     Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
> ParErr- Stepping- SERR- FastB2B- DisINTx-
>     Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort-
> <TAbort- <MAbort- >SERR- <PERR- INTx-
>     Latency: 0, Cache Line Size: 64 bytes
>     Bus: primary=00, secondary=03, subordinate=03, sec-latency=0
>     I/O behind bridge: 0000f000-00000fff
>     Memory behind bridge: f7c00000-f7cfffff
>     Prefetchable memory behind bridge: 00000000fff00000-00000000000fffff
>     Secondary status: 66MHz- FastB2B- ParErr- DEVSEL=fast >TAbort-
> <TAbort- <MAbort+ <SERR- <PERR-
>     BridgeCtl: Parity- SERR- NoISA- VGA- MAbort- >Reset- FastB2B-
>         PriDiscTmr- SecDiscTmr- DiscTmrStat- DiscTmrSERREn-
>     Capabilities: [40] Express (v2) Root Port (Slot+), MSI 00
>         DevCap:    MaxPayload 128 bytes, PhantFunc 0
>             ExtTag- RBE+
>         DevCtl:    Report errors: Correctable- Non-Fatal- Fatal- Unsupported-
>             RlxdOrd- ExtTag- PhantFunc- AuxPwr- NoSnoop-
>             MaxPayload 128 bytes, MaxReadReq 128 bytes
>         DevSta:    CorrErr- UncorrErr- FatalErr- UnsuppReq- AuxPwr+ TransPend-
>         LnkCap:    Port #4, Speed 5GT/s, Width x1, ASPM L0s L1, Exit
> Latency L0s <512ns, L1 <16us
>             ClockPM- Surprise- LLActRep+ BwNot+
>         LnkCtl:    ASPM Disabled; RCB 64 bytes Disabled- CommClk+
>             ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
>         LnkSta:    Speed 2.5GT/s, Width x1, TrErr- Train- SlotClk+
> DLActive+ BWMgmt+ ABWMgmt-
>         SltCap:    AttnBtn- PwrCtrl- MRL- AttnInd- PwrInd- HotPlug- Surprise-
>             Slot #3, PowerLimit 10.000W; Interlock- NoCompl+
>         SltCtl:    Enable: AttnBtn- PwrFlt- MRL- PresDet- CmdCplt-
> HPIrq- LinkChg-
>             Control: AttnInd Unknown, PwrInd Unknown, Power- Interlock-
>         SltSta:    Status: AttnBtn- PowerFlt- MRL- CmdCplt- PresDet+ Interlock-
>             Changed: MRL- PresDet- LinkState-
>         RootCtl: ErrCorrectable- ErrNon-Fatal- ErrFatal- PMEIntEna- CRSVisible-
>         RootCap: CRSVisible-
>         RootSta: PME ReqID 0000, PMEStatus- PMEPending-
>         DevCap2: Completion Timeout: Range ABC, TimeoutDis+, LTR+,
> OBFF Not Supported ARIFwd-
>         DevCtl2: Completion Timeout: 50us to 50ms, TimeoutDis-, LTR+,
> OBFF Disabled ARIFwd-
>         LnkCtl2: Target Link Speed: 5GT/s, EnterCompliance- SpeedDis-
>              Transmit Margin: Normal Operating Range,
> EnterModifiedCompliance- ComplianceSOS-
>              Compliance De-emphasis: -6dB
>         LnkSta2: Current De-emphasis Level: -3.5dB,
> EqualizationComplete-, EqualizationPhase1-
>              EqualizationPhase2-, EqualizationPhase3-, LinkEqualizationRequest-
>     Capabilities: [80] MSI: Enable- Count=1/1 Maskable- 64bit-
>         Address: 00000000  Data: 0000
>     Capabilities: [90] Subsystem: ASUSTeK Computer Inc. Device 15ad
>     Capabilities: [a0] Power Management version 3
>         Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA
> PME(D0+,D1-,D2-,D3hot+,D3cold+)
>         Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
>     Capabilities: [100 v0] #00
>     Capabilities: [200 v1] L1 PM Substates
>         L1SubCap: PCI-PM_L1.2+ PCI-PM_L1.1+ ASPM_L1.2+ ASPM_L1.1+
> L1_PM_Substates+
>               PortCommonModeRestoreTime=40us PortTPowerOnTime=10us
>     Kernel driver in use: pcieport
>
> 00:1d.0 USB controller: Intel Corporation Lynx Point-LP USB EHCI #1
> (rev 04) (prog-if 20 [EHCI])
>     Subsystem: ASUSTeK Computer Inc. Device 201f
>     Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
> ParErr- Stepping- SERR- FastB2B- DisINTx-
>     Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort-
> <TAbort- <MAbort- >SERR- <PERR- INTx-
>     Latency: 0
>     Interrupt: pin A routed to IRQ 23
>     Region 0: Memory at f7e23000 (32-bit, non-prefetchable) [size=1K]
>     Capabilities: [50] Power Management version 3
>         Flags: PMEClk- DSI- D1- D2- AuxCurrent=375mA
> PME(D0+,D1-,D2-,D3hot+,D3cold+)
>         Status: D0 NoSoftRst+ PME-Enable- DSel=0 DScale=0 PME-
>     Capabilities: [58] Debug port: BAR=1 offset=00a0
>     Capabilities: [98] PCI Advanced Features
>         AFCap: TP+ FLR+
>         AFCtrl: FLR-
>         AFStatus: TP-
>     Kernel driver in use: ehci-pci
>
> 00:1f.0 ISA bridge: Intel Corporation Lynx Point-LP LPC Controller (rev 04)
>     Subsystem: ASUSTeK Computer Inc. Device 15ad
>     Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
> ParErr- Stepping- SERR- FastB2B- DisINTx-
>     Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort-
> <TAbort- <MAbort- >SERR- <PERR- INTx-
>     Latency: 0
>     Capabilities: [e0] Vendor Specific Information: Len=0c <?>
>     Kernel driver in use: lpc_ich
>
> 00:1f.2 SATA controller: Intel Corporation Lynx Point-LP SATA
> Controller 1 [AHCI mode] (rev 04) (prog-if 01 [AHCI 1.0])
>     Subsystem: ASUSTeK Computer Inc. Device 15ad
>     Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
> ParErr- Stepping- SERR- FastB2B- DisINTx+
>     Status: Cap+ 66MHz+ UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort-
> <TAbort- <MAbort- >SERR- <PERR- INTx-
>     Latency: 0
>     Interrupt: pin B routed to IRQ 42
>     Region 0: I/O ports at f0b0 [size=8]
>     Region 1: I/O ports at f0a0 [size=4]
>     Region 2: I/O ports at f090 [size=8]
>     Region 3: I/O ports at f080 [size=4]
>     Region 4: I/O ports at f060 [size=32]
>     Region 5: Memory at f7e22000 (32-bit, non-prefetchable) [size=2K]
>     Capabilities: [80] MSI: Enable+ Count=1/1 Maskable- 64bit-
>         Address: fee0a00c  Data: 41c1
>     Capabilities: [70] Power Management version 3
>         Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA
> PME(D0-,D1-,D2-,D3hot+,D3cold-)
>         Status: D0 NoSoftRst+ PME-Enable- DSel=0 DScale=0 PME-
>     Capabilities: [a8] SATA HBA v1.0 BAR4 Offset=00000004
>     Kernel driver in use: ahci
>
> 00:1f.3 SMBus: Intel Corporation Lynx Point-LP SMBus Controller (rev 04)
>     Subsystem: ASUSTeK Computer Inc. Device 15ad
>     Control: I/O+ Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop-
> ParErr- Stepping- SERR- FastB2B- DisINTx-
>     Status: Cap- 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort-
> <TAbort- <MAbort- >SERR- <PERR- INTx-
>     Interrupt: pin C routed to IRQ 3
>     Region 0: Memory at f7e21000 (64-bit, non-prefetchable) [size=256]
>     Region 4: I/O ports at f040 [size=32]
>
> 00:1f.6 Signal processing controller: Intel Corporation Lynx Point-LP
> Thermal (rev 04)
>     Subsystem: ASUSTeK Computer Inc. Device 15ad
>     Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
> ParErr- Stepping- SERR- FastB2B- DisINTx-
>     Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort-
> <TAbort- <MAbort- >SERR- <PERR- INTx-
>     Latency: 0
>     Interrupt: pin C routed to IRQ 3
>     Region 0: Memory at f7e20000 (64-bit, non-prefetchable) [size=4K]
>     Capabilities: [50] Power Management version 3
>         Flags: PMEClk- DSI+ D1- D2- AuxCurrent=0mA
> PME(D0-,D1-,D2-,D3hot-,D3cold-)
>         Status: D0 NoSoftRst+ PME-Enable- DSel=0 DScale=0 PME-
>     Capabilities: [80] MSI: Enable- Count=1/1 Maskable- 64bit-
>         Address: 00000000  Data: 0000
>
> 02:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd.
> Device 5287 (rev 01)
>     Subsystem: ASUSTeK Computer Inc. Device 202f
>     Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
> ParErr- Stepping- SERR- FastB2B- DisINTx+
>     Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort-
> <TAbort- <MAbort- >SERR- <PERR- INTx-
>     Latency: 0, Cache Line Size: 64 bytes
>     Interrupt: pin B routed to IRQ 41
>     Region 0: Memory at f7d15000 (32-bit, non-prefetchable) [size=4K]
>     Expansion ROM at f7d00000 [disabled] [size=64K]
>     Capabilities: [40] Power Management version 3
>         Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=375mA
> PME(D0-,D1+,D2+,D3hot+,D3cold+)
>         Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
>     Capabilities: [50] MSI: Enable+ Count=1/1 Maskable- 64bit+
>         Address: 00000000fee0f00c  Data: 41b1
>     Capabilities: [70] Express (v2) Endpoint, MSI 00
>         DevCap:    MaxPayload 128 bytes, PhantFunc 0, Latency L0s
> <512ns, L1 <64us
>             ExtTag- AttnBtn- AttnInd- PwrInd- RBE+ FLReset-
>         DevCtl:    Report errors: Correctable- Non-Fatal- Fatal- Unsupported-
>             RlxdOrd- ExtTag- PhantFunc- AuxPwr- NoSnoop-
>             MaxPayload 128 bytes, MaxReadReq 512 bytes
>         DevSta:    CorrErr+ UncorrErr- FatalErr- UnsuppReq+ AuxPwr+ TransPend-
>         LnkCap:    Port #0, Speed 2.5GT/s, Width x1, ASPM L0s L1, Exit
> Latency L0s unlimited, L1 <64us
>             ClockPM+ Surprise- LLActRep- BwNot-
>         LnkCtl:    ASPM L1 Enabled; RCB 64 bytes Disabled- CommClk-
>             ExtSynch- ClockPM+ AutWidDis- BWInt- AutBWInt-
>         LnkSta:    Speed 2.5GT/s, Width x1, TrErr- Train- SlotClk+
> DLActive- BWMgmt- ABWMgmt-
>         DevCap2: Completion Timeout: Range ABCD, TimeoutDis+, LTR+,
> OBFF Via message/WAKE#
>         DevCtl2: Completion Timeout: 50us to 50ms, TimeoutDis-, LTR+,
> OBFF Disabled
>         LnkCtl2: Target Link Speed: 2.5GT/s, EnterCompliance- SpeedDis-
>              Transmit Margin: Normal Operating Range,
> EnterModifiedCompliance- ComplianceSOS-
>              Compliance De-emphasis: -6dB
>         LnkSta2: Current De-emphasis Level: -6dB,
> EqualizationComplete-, EqualizationPhase1-
>              EqualizationPhase2-, EqualizationPhase3-, LinkEqualizationRequest-
>     Capabilities: [b0] MSI-X: Enable- Count=1 Masked-
>         Vector table: BAR=0 offset=00000000
>         PBA: BAR=0 offset=00000000
>     Capabilities: [d0] Vital Product Data
> pcilib: sysfs_read_vpd: read failed: Connection timed out
>         Not readable
>     Capabilities: [100 v2] Advanced Error Reporting
>         UESta:    DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt-
> RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
>         UEMsk:    DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt-
> RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
>         UESvrt:    DLP+ SDES+ TLP- FCP+ CmpltTO- CmpltAbrt- UnxCmplt-
> RxOF+ MalfTLP+ ECRC- UnsupReq- ACSViol-
>         CESta:    RxErr- BadTLP- BadDLLP- Rollover- Timeout- NonFatalErr+
>         CEMsk:    RxErr- BadTLP- BadDLLP- Rollover- Timeout- NonFatalErr+
>         AERCap:    First Error Pointer: 00, GenCap+ CGenEn- ChkCap+ ChkEn-
>     Capabilities: [140 v1] Virtual Channel
>         Caps:    LPEVC=0 RefClk=100ns PATEntryBits=1
>         Arb:    Fixed- WRR32- WRR64- WRR128-
>         Ctrl:    ArbSelect=Fixed
>         Status:    InProgress-
>         VC0:    Caps:    PATOffset=00 MaxTimeSlots=1 RejSnoopTrans-
>             Arb:    Fixed- WRR32- WRR64- WRR128- TWRR128- WRR256-
>             Ctrl:    Enable+ ID=0 ArbSelect=Fixed TC/VC=01
>             Status:    NegoPending- InProgress-
>     Capabilities: [160 v1] Device Serial Number 00-00-00-00-00-00-00-00
>     Capabilities: [170 v1] Latency Tolerance Reporting
>         Max snoop latency: 3145728ns
>         Max no snoop latency: 3145728ns
>     Capabilities: [178 v1] L1 PM Substates
>         L1SubCap: PCI-PM_L1.2+ PCI-PM_L1.1+ ASPM_L1.2+ ASPM_L1.1+
> L1_PM_Substates+
>               PortCommonModeRestoreTime=150us PortTPowerOnTime=150us
>     Kernel driver in use: rtsx_pci
>
> 02:00.1 Ethernet controller: Realtek Semiconductor Co., Ltd.
> RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 12)
>     Subsystem: ASUSTeK Computer Inc. Device 200f
>     Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
> ParErr- Stepping- SERR- FastB2B- DisINTx+
>     Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort-
> <TAbort- <MAbort- >SERR- <PERR- INTx-
>     Latency: 0, Cache Line Size: 64 bytes
>     Interrupt: pin A routed to IRQ 43
>     Region 0: I/O ports at e000 [size=256]
>     Region 2: Memory at f7d14000 (64-bit, non-prefetchable) [size=4K]
>     Region 4: Memory at f7d10000 (64-bit, non-prefetchable) [size=16K]
>     Capabilities: [40] Power Management version 3
>         Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=375mA
> PME(D0+,D1+,D2+,D3hot+,D3cold+)
>         Status: D0 NoSoftRst+ PME-Enable- DSel=0 DScale=0 PME-
>     Capabilities: [50] MSI: Enable+ Count=1/1 Maskable- 64bit+
>         Address: 00000000fee0100c  Data: 41d1
>     Capabilities: [70] Express (v2) Endpoint, MSI 01
>         DevCap:    MaxPayload 128 bytes, PhantFunc 0, Latency L0s
> <512ns, L1 <64us
>             ExtTag- AttnBtn- AttnInd- PwrInd- RBE+ FLReset-
>         DevCtl:    Report errors: Correctable- Non-Fatal- Fatal- Unsupported-
>             RlxdOrd- ExtTag- PhantFunc- AuxPwr- NoSnoop-
>             MaxPayload 128 bytes, MaxReadReq 4096 bytes
>         DevSta:    CorrErr+ UncorrErr- FatalErr- UnsuppReq+ AuxPwr+ TransPend-
>         LnkCap:    Port #0, Speed 2.5GT/s, Width x1, ASPM L0s L1, Exit
> Latency L0s unlimited, L1 <64us
>             ClockPM+ Surprise- LLActRep- BwNot-
>         LnkCtl:    ASPM Disabled; RCB 64 bytes Disabled- CommClk+
>             ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
>         LnkSta:    Speed 2.5GT/s, Width x1, TrErr- Train- SlotClk+
> DLActive- BWMgmt- ABWMgmt-
>         DevCap2: Completion Timeout: Range ABCD, TimeoutDis+, LTR+,
> OBFF Via message/WAKE#
>         DevCtl2: Completion Timeout: 50us to 50ms, TimeoutDis-, LTR-,
> OBFF Disabled
>         LnkSta2: Current De-emphasis Level: -6dB,
> EqualizationComplete-, EqualizationPhase1-
>              EqualizationPhase2-, EqualizationPhase3-, LinkEqualizationRequest-
>     Capabilities: [b0] MSI-X: Enable- Count=4 Masked-
>         Vector table: BAR=4 offset=00000000
>         PBA: BAR=4 offset=00000800
>     Capabilities: [d0] Vital Product Data
>         Unknown small resource type 00, will not decode more.
>     Capabilities: [100 v2] Advanced Error Reporting
>         UESta:    DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt-
> RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
>         UEMsk:    DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt-
> RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
>         UESvrt:    DLP+ SDES+ TLP- FCP+ CmpltTO- CmpltAbrt- UnxCmplt-
> RxOF+ MalfTLP+ ECRC- UnsupReq- ACSViol-
>         CESta:    RxErr- BadTLP- BadDLLP- Rollover- Timeout- NonFatalErr+
>         CEMsk:    RxErr- BadTLP- BadDLLP- Rollover- Timeout- NonFatalErr+
>         AERCap:    First Error Pointer: 00, GenCap+ CGenEn- ChkCap+ ChkEn-
>     Capabilities: [160 v1] Device Serial Number 09-25-01-13-68-4c-e0-00
>     Capabilities: [170 v1] Latency Tolerance Reporting
>         Max snoop latency: 3145728ns
>         Max no snoop latency: 3145728ns
>     Capabilities: [178 v1] L1 PM Substates
>         L1SubCap: PCI-PM_L1.2+ PCI-PM_L1.1+ ASPM_L1.2+ ASPM_L1.1+
> L1_PM_Substates+
>               PortCommonModeRestoreTime=150us PortTPowerOnTime=150us
>     Kernel driver in use: r8169
>
> 03:00.0 Network controller: Qualcomm Atheros QCA9565 / AR9565 Wireless
> Network Adapter (rev 01)
>     Subsystem: AzureWave Device 2130
>     Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
> ParErr- Stepping- SERR- FastB2B- DisINTx-
>     Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort-
> <TAbort- <MAbort- >SERR- <PERR- INTx-
>     Latency: 0, Cache Line Size: 64 bytes
>     Interrupt: pin A routed to IRQ 19
>     Region 0: Memory at f7c00000 (64-bit, non-prefetchable) [size=512K]
>     Expansion ROM at f7c80000 [disabled] [size=64K]
>     Capabilities: [40] Power Management version 2
>         Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=375mA
> PME(D0+,D1+,D2+,D3hot+,D3cold+)
>         Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
>     Capabilities: [50] MSI: Enable- Count=1/4 Maskable+ 64bit+
>         Address: 0000000000000000  Data: 0000
>         Masking: 00000000  Pending: 00000000
>     Capabilities: [70] Express (v2) Endpoint, MSI 00
>         DevCap:    MaxPayload 128 bytes, PhantFunc 0, Latency L0s
> unlimited, L1 <64us
>             ExtTag- AttnBtn- AttnInd- PwrInd- RBE+ FLReset-
>         DevCtl:    Report errors: Correctable- Non-Fatal- Fatal- Unsupported-
>             RlxdOrd- ExtTag- PhantFunc- AuxPwr- NoSnoop-
>             MaxPayload 128 bytes, MaxReadReq 512 bytes
>         DevSta:    CorrErr+ UncorrErr- FatalErr- UnsuppReq+ AuxPwr+ TransPend-
>         LnkCap:    Port #0, Speed 2.5GT/s, Width x1, ASPM L0s L1, Exit
> Latency L0s <4us, L1 <64us
>             ClockPM- Surprise- LLActRep- BwNot-
>         LnkCtl:    ASPM Disabled; RCB 64 bytes Disabled- CommClk+
>             ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
>         LnkSta:    Speed 2.5GT/s, Width x1, TrErr- Train- SlotClk+
> DLActive- BWMgmt- ABWMgmt-
>         DevCap2: Completion Timeout: Not Supported, TimeoutDis+, LTR-,
> OBFF Not Supported
>         DevCtl2: Completion Timeout: 50us to 50ms, TimeoutDis-, LTR-,
> OBFF Disabled
>         LnkCtl2: Target Link Speed: 2.5GT/s, EnterCompliance- SpeedDis-
>              Transmit Margin: Normal Operating Range,
> EnterModifiedCompliance- ComplianceSOS-
>              Compliance De-emphasis: -6dB
>         LnkSta2: Current De-emphasis Level: -6dB,
> EqualizationComplete-, EqualizationPhase1-
>              EqualizationPhase2-, EqualizationPhase3-, LinkEqualizationRequest-
>     Capabilities: [100 v1] Advanced Error Reporting
>         UESta:    DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt-
> RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
>         UEMsk:    DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt-
> RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
>         UESvrt:    DLP+ SDES+ TLP- FCP+ CmpltTO- CmpltAbrt- UnxCmplt-
> RxOF+ MalfTLP+ ECRC- UnsupReq- ACSViol-
>         CESta:    RxErr- BadTLP- BadDLLP- Rollover- Timeout- NonFatalErr+
>         CEMsk:    RxErr- BadTLP- BadDLLP- Rollover- Timeout- NonFatalErr+
>         AERCap:    First Error Pointer: 00, GenCap- CGenEn- ChkCap- ChkEn-
>     Capabilities: [140 v1] Virtual Channel
>         Caps:    LPEVC=0 RefClk=100ns PATEntryBits=1
>         Arb:    Fixed- WRR32- WRR64- WRR128-
>         Ctrl:    ArbSelect=Fixed
>         Status:    InProgress-
>         VC0:    Caps:    PATOffset=00 MaxTimeSlots=1 RejSnoopTrans-
>             Arb:    Fixed- WRR32- WRR64- WRR128- TWRR128- WRR256-
>             Ctrl:    Enable+ ID=0 ArbSelect=Fixed TC/VC=01
>             Status:    NegoPending- InProgress-
>     Capabilities: [160 v1] Device Serial Number 00-00-00-00-00-00-00-00
>     Kernel driver in use: ath9k
>
> [7.6.] SCSI information
> $ cat /proc/scsi/scsi
> Attached devices:
> Host: scsi0 Channel: 00 Id: 00 Lun: 00
>   Vendor: ATA      Model: ST1000LM024 HN-M Rev: 0001
>   Type:   Direct-Access                    ANSI  SCSI revision: 05
> Host: scsi1 Channel: 00 Id: 00 Lun: 00
>   Vendor: TSSTcorp Model: CDDVDW SU-228FB  Rev: AS00
>   Type:   CD-ROM                           ANSI  SCSI revision: 05
>
> [7.7.] Other information that might be relevant to the problem
> $ ls /proc
> 1     1301  1495  1573  1830  1957  2114  24    3011  31    3288  3582
>  38    43    55    7698  9          devices      kpagecount
> slabinfo
> 10    1311  1499  1574  1832  1958  2119  25    3012  3101  3290  36
>  3888  44    581   771   90         diskstats    kpageflags
> softirqs
> 102   1330  15    1580  1851  1961  2130  26    3018  3155  33    3600
>  389   45    5883  786   922        dma          loadavg       stat
> 1053  1342  150   1583  1854  1962  2151  2622  3022  3160  34    361
>  39    46    5972  8     975        driver       locks         swaps
> 1054  1347  1504  1585  1856  1967  22    2651  3025  3163  35    3615
>  390   4622  611   802   979        execdomains  mdstat        sys
> 1055  1361  151   1587  1858  1978  2200  2655  3031  3166  3500  3654
>  391   4638  6581  803   986        fb           meminfo
> sysrq-trigger
> 1062  14    152   1596  1859  2     2205  27    3036  3169  3501  3662
>  3926  466   665   818   987        filesystems  misc          sysvipc
> 1065  142   1520  1609  1860  20    2227  2731  304   3176  3503  3676
>  3933  468   6663  824   990        fs           modules
> thread-self
> 1084  144   1532  1619  1861  2032  2230  28    3046  3179  3504  3681
>  3934  47    6664  829   acpi       interrupts   mounts
> timer_list
> 1088  145   1537  163   1862  2036  2231  29    3048  3185  3506  3687
>  396   472   67    835   asound     iomem        mtrr
> timer_stats
> 11    146   1539  1683  1864  2046  2232  2936  3050  3187  3507  3693
>  4     473   68    841   buddyinfo  ioports      net           tty
> 1163  147   1540  1685  1897  2050  2242  2939  3058  32    3515  37
>  40    48    69    842   bus        irq          pagetypeinfo  uptime
> 1180  148   1542  17    19    2059  2244  296   3059  3204  3542  3708
>  4065  5     7     864   cgroups    kallsyms     partitions    version
> 12    1483  1564  172   1906  2063  2248  2991  3061  3223  3554  3728
>  41    50    70    870   cmdline    kcore        sched_debug
> vmallocinfo
> 1285  1485  1568  1723  1953  2091  2256  3     3083  3241  3559  375
>  42    51    7244  89    consoles   keys         schedstat     vmstat
> 1288  1486  157   173   1955  2099  2272  3000  3089  3248  3563  3754
>  4288  53    7533  893   cpuinfo    key-users    scsi
> zoneinfo
> 13    149   1571  18    1956  21    2355  3004  3095  3281  3575  3790
>  4289  54    760   897   crypto     kmsg         self
> --
> To unsubscribe from this list: send the line "unsubscribe linux-input" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


^ permalink raw reply

* PROBLEM: Asus X751LA Touchpad not recognised
From: Luca Manunta @ 2014-11-10 22:13 UTC (permalink / raw)
  To: linux-input

[1.] One line summary of the problem:
[Asus X751LA] Touchpad not recognised

[2.] Full description of the problem/report:
The touchpad is currently working as a PS/2 mouse, however this
prevents from using synaptics/syndaemon to suspend touching while
typing, and double finger scrolling. The only solution is to toggle
the PS/2 mouse off and use an external mouse.

[3.] Keywords: n/a

[4.] Kernel version (from /proc/version):
$ cat /proc/version
Linux version 3.18.0-031800rc4-generic (apw@gomeisa) (gcc version
4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) ) #201411091835 SMP Sun Nov 9
23:36:36 UTC 2014

[5.] Output of Oops.. message: n/a

[6.] A small shell script or example program which triggers the
problem (if possible): n/a

[7.] Environment
$ lsb_release -rd
Description:    Ubuntu 14.04.1 LTS
Release:    14.04

[7.1.] Software
$ sh ver_linux
If some fields are empty or look unusual you may have an old version.
Compare to the current minimal requirements in Documentation/Changes.

Linux bojanasus 3.18.0-031800rc4-generic #201411091835 SMP Sun Nov 9
23:36:36 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

Gnu C                  4.8
Gnu make               3.81
binutils               2.24
util-linux             2.20.1
mount                  support
module-init-tools      15
e2fsprogs              1.42.9
pcmciautils            018
Linux C Library        2.19
Dynamic linker (ldd)   2.19
Procps                 3.3.9
Net-tools              1.60
Kbd                    1.15.5
Sh-utils               8.21
wireless-tools         30
Modules Loaded         ctr ccm bnep rfcomm binfmt_misc nls_iso8859_1
intel_rapl x86_pkg_temp_thermal intel_powerclamp coretemp kvm_intel
kvm crct10dif_pclmul crc32_pclmul ghash_clmulni_intel aesni_intel
aes_x86_64 lrw gf128mul arc4 glue_helper uvcvideo ablk_helper ath9k
videobuf2_vmalloc cryptd videobuf2_memops ath9k_common ath9k_hw
videobuf2_core ath v4l2_common videodev mac80211 cfg80211 asus_nb_wmi
snd_hda_codec_hdmi asus_wmi media joydev sparse_keymap serio_raw
pcspkr snd_hda_codec_realtek snd_hda_codec_generic i915 parport_pc
ppdev snd_hda_intel drm_kms_helper snd_soc_rt5640 lpc_ich btusb
snd_hda_controller snd_soc_rl6231 i2c_hid snd_soc_core snd_hda_codec
bluetooth snd_hwdep lp snd_seq_midi int3400_thermal dw_dmac
snd_compress video dw_dmac_core mei_me snd_pcm_dmaengine snd_pcm
int3402_thermal acpi_thermal_rel drm mei rtsx_pci_ms wmi memstick
i2c_algo_bit i2c_designware_platform snd_seq_midi_event
i2c_designware_core snd_rawmidi snd_seq parport spi_pxa2xx_platform
mac_hid snd_seq_device snd_timer snd soundcore snd_soc_sst_acpi
8250_dw hid_generic usbhid hid rtsx_pci_sdmmc r8169 mii psmouse ahci
libahci rtsx_pci sdhci_acpi sdhci


[7.2.] Processor information
$ cat /proc/cpuinfo
processor    : 0
vendor_id    : GenuineIntel
cpu family    : 6
model        : 69
model name    : Intel(R) Core(TM) i7-4500U CPU @ 1.80GHz
stepping    : 1
microcode    : 0x15
cpu MHz        : 1800.000
cache size    : 4096 KB
physical id    : 0
siblings    : 4
core id        : 0
cpu cores    : 2
apicid        : 0
initial apicid    : 0
fpu        : yes
fpu_exception    : yes
cpuid level    : 13
wp        : yes
flags        : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge
mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe
syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts
rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq
dtes64 monitor ds_cpl vmx est tm2 ssse3 fma cx16 xtpr pdcm pcid sse4_1
sse4_2 movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand
lahf_lm abm ida arat epb pln pts dtherm tpr_shadow vnmi flexpriority
ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid xsaveopt
bugs        :
bogomips    : 4793.19
clflush size    : 64
cache_alignment    : 64
address sizes    : 39 bits physical, 48 bits virtual
power management:

processor    : 1
vendor_id    : GenuineIntel
cpu family    : 6
model        : 69
model name    : Intel(R) Core(TM) i7-4500U CPU @ 1.80GHz
stepping    : 1
microcode    : 0x15
cpu MHz        : 1800.000
cache size    : 4096 KB
physical id    : 0
siblings    : 4
core id        : 1
cpu cores    : 2
apicid        : 2
initial apicid    : 2
fpu        : yes
fpu_exception    : yes
cpuid level    : 13
wp        : yes
flags        : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge
mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe
syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts
rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq
dtes64 monitor ds_cpl vmx est tm2 ssse3 fma cx16 xtpr pdcm pcid sse4_1
sse4_2 movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand
lahf_lm abm ida arat epb pln pts dtherm tpr_shadow vnmi flexpriority
ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid xsaveopt
bugs        :
bogomips    : 4793.19
clflush size    : 64
cache_alignment    : 64
address sizes    : 39 bits physical, 48 bits virtual
power management:

processor    : 2
vendor_id    : GenuineIntel
cpu family    : 6
model        : 69
model name    : Intel(R) Core(TM) i7-4500U CPU @ 1.80GHz
stepping    : 1
microcode    : 0x15
cpu MHz        : 1803.750
cache size    : 4096 KB
physical id    : 0
siblings    : 4
core id        : 0
cpu cores    : 2
apicid        : 1
initial apicid    : 1
fpu        : yes
fpu_exception    : yes
cpuid level    : 13
wp        : yes
flags        : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge
mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe
syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts
rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq
dtes64 monitor ds_cpl vmx est tm2 ssse3 fma cx16 xtpr pdcm pcid sse4_1
sse4_2 movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand
lahf_lm abm ida arat epb pln pts dtherm tpr_shadow vnmi flexpriority
ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid xsaveopt
bugs        :
bogomips    : 4793.19
clflush size    : 64
cache_alignment    : 64
address sizes    : 39 bits physical, 48 bits virtual
power management:

processor    : 3
vendor_id    : GenuineIntel
cpu family    : 6
model        : 69
model name    : Intel(R) Core(TM) i7-4500U CPU @ 1.80GHz
stepping    : 1
microcode    : 0x15
cpu MHz        : 1803.000
cache size    : 4096 KB
physical id    : 0
siblings    : 4
core id        : 1
cpu cores    : 2
apicid        : 3
initial apicid    : 3
fpu        : yes
fpu_exception    : yes
cpuid level    : 13
wp        : yes
flags        : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge
mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe
syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts
rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq
dtes64 monitor ds_cpl vmx est tm2 ssse3 fma cx16 xtpr pdcm pcid sse4_1
sse4_2 movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand
lahf_lm abm ida arat epb pln pts dtherm tpr_shadow vnmi flexpriority
ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid xsaveopt
bugs        :
bogomips    : 4793.19
clflush size    : 64
cache_alignment    : 64
address sizes    : 39 bits physical, 48 bits virtual
power management:

[7.3.] Module information
$ cat /proc/modules
ctr 13193 1 - Live 0x0000000000000000
ccm 17856 1 - Live 0x0000000000000000
bnep 23980 2 - Live 0x0000000000000000
rfcomm 75066 12 - Live 0x0000000000000000
binfmt_misc 17501 1 - Live 0x0000000000000000
nls_iso8859_1 12713 1 - Live 0x0000000000000000
intel_rapl 19196 0 - Live 0x0000000000000000
x86_pkg_temp_thermal 14312 0 - Live 0x0000000000000000
intel_powerclamp 19099 0 - Live 0x0000000000000000
coretemp 13638 0 - Live 0x0000000000000000
kvm_intel 149984 0 - Live 0x0000000000000000
kvm 475233 1 kvm_intel, Live 0x0000000000000000
crct10dif_pclmul 14268 0 - Live 0x0000000000000000
crc32_pclmul 13180 0 - Live 0x0000000000000000
ghash_clmulni_intel 13230 0 - Live 0x0000000000000000
aesni_intel 169686 2 - Live 0x0000000000000000
aes_x86_64 17131 1 aesni_intel, Live 0x0000000000000000
lrw 13323 1 aesni_intel, Live 0x0000000000000000
gf128mul 14951 1 lrw, Live 0x0000000000000000
arc4 12573 2 - Live 0x0000000000000000
glue_helper 14095 1 aesni_intel, Live 0x0000000000000000
uvcvideo 86723 0 - Live 0x0000000000000000
ablk_helper 13597 1 aesni_intel, Live 0x0000000000000000
ath9k 162133 0 - Live 0x0000000000000000
videobuf2_vmalloc 13216 1 uvcvideo, Live 0x0000000000000000
cryptd 20531 3 ghash_clmulni_intel,aesni_intel,ablk_helper, Live
0x0000000000000000
videobuf2_memops 13362 1 videobuf2_vmalloc, Live 0x0000000000000000
ath9k_common 25638 1 ath9k, Live 0x0000000000000000
ath9k_hw 460416 2 ath9k,ath9k_common, Live 0x0000000000000000
videobuf2_core 51547 1 uvcvideo, Live 0x0000000000000000
ath 29397 3 ath9k,ath9k_common,ath9k_hw, Live 0x0000000000000000
v4l2_common 15715 1 videobuf2_core, Live 0x0000000000000000
videodev 163831 3 uvcvideo,videobuf2_core,v4l2_common, Live 0x0000000000000000
mac80211 697143 1 ath9k, Live 0x0000000000000000
cfg80211 520257 4 ath9k,ath9k_common,ath,mac80211, Live 0x0000000000000000
asus_nb_wmi 21128 0 - Live 0x0000000000000000
snd_hda_codec_hdmi 52670 1 - Live 0x0000000000000000
asus_wmi 24697 1 asus_nb_wmi, Live 0x0000000000000000
media 22008 2 uvcvideo,videodev, Live 0x0000000000000000
joydev 17587 0 - Live 0x0000000000000000
sparse_keymap 13890 1 asus_wmi, Live 0x0000000000000000
serio_raw 13483 0 - Live 0x0000000000000000
pcspkr 12718 0 - Live 0x0000000000000000
snd_hda_codec_realtek 80418 1 - Live 0x0000000000000000
snd_hda_codec_generic 69995 1 snd_hda_codec_realtek, Live 0x0000000000000000
i915 1031913 9 - Live 0x0000000000000000
parport_pc 32909 0 - Live 0x0000000000000000
ppdev 17711 0 - Live 0x0000000000000000
snd_hda_intel 30783 17 - Live 0x0000000000000000
drm_kms_helper 99802 1 i915, Live 0x0000000000000000
snd_soc_rt5640 93325 0 - Live 0x0000000000000000
lpc_ich 21176 0 - Live 0x0000000000000000
btusb 32691 0 - Live 0x0000000000000000
snd_hda_controller 32234 1 snd_hda_intel, Live 0x0000000000000000
snd_soc_rl6231 13037 1 snd_soc_rt5640, Live 0x0000000000000000
i2c_hid 19065 0 - Live 0x0000000000000000
snd_soc_core 207596 1 snd_soc_rt5640, Live 0x0000000000000000
snd_hda_codec 144641 5
snd_hda_codec_hdmi,snd_hda_codec_realtek,snd_hda_codec_generic,snd_hda_intel,snd_hda_controller,
Live 0x0000000000000000
bluetooth 486890 22 bnep,rfcomm,btusb, Live 0x0000000000000000
snd_hwdep 17709 1 snd_hda_codec, Live 0x0000000000000000
lp 17799 0 - Live 0x0000000000000000
snd_seq_midi 13564 0 - Live 0x0000000000000000
int3400_thermal 13040 0 - Live 0x0000000000000000
dw_dmac 12835 0 - Live 0x0000000000000000
snd_compress 19395 1 snd_soc_core, Live 0x0000000000000000
video 20649 2 asus_wmi,i915, Live 0x0000000000000000
dw_dmac_core 28558 1 dw_dmac, Live 0x0000000000000000
mei_me 19565 0 - Live 0x0000000000000000
snd_pcm_dmaengine 15229 1 snd_soc_core, Live 0x0000000000000000
snd_pcm 106273 8
snd_hda_codec_hdmi,snd_hda_intel,snd_soc_rt5640,snd_hda_controller,snd_soc_core,snd_hda_codec,snd_pcm_dmaengine,
Live 0x0000000000000000
int3402_thermal 13060 0 - Live 0x0000000000000000
acpi_thermal_rel 13807 1 int3400_thermal, Live 0x0000000000000000
drm 323675 8 i915,drm_kms_helper, Live 0x0000000000000000
mei 88473 1 mei_me, Live 0x0000000000000000
rtsx_pci_ms 18337 0 - Live 0x0000000000000000
wmi 19379 1 asus_wmi, Live 0x0000000000000000
memstick 16968 1 rtsx_pci_ms, Live 0x0000000000000000
i2c_algo_bit 13564 1 i915, Live 0x0000000000000000
i2c_designware_platform 13025 0 - Live 0x0000000000000000
snd_seq_midi_event 14899 1 snd_seq_midi, Live 0x0000000000000000
i2c_designware_core 14990 1 i2c_designware_platform, Live 0x0000000000000000
snd_rawmidi 31197 1 snd_seq_midi, Live 0x0000000000000000
snd_seq 63540 2 snd_seq_midi,snd_seq_midi_event, Live 0x0000000000000000
parport 42481 3 parport_pc,ppdev,lp, Live 0x0000000000000000
spi_pxa2xx_platform 23256 0 - Live 0x0000000000000000
mac_hid 13275 0 - Live 0x0000000000000000
snd_seq_device 14497 3 snd_seq_midi,snd_rawmidi,snd_seq, Live 0x0000000000000000
snd_timer 30118 2 snd_pcm,snd_seq, Live 0x0000000000000000
snd 84025 46 snd_hda_codec_hdmi,snd_hda_codec_realtek,snd_hda_codec_generic,snd_hda_intel,snd_soc_core,snd_hda_codec,snd_hwdep,snd_compress,snd_pcm,snd_rawmidi,snd_seq,snd_seq_device,snd_timer,
Live 0x0000000000000000
soundcore 15091 2 snd_hda_codec,snd, Live 0x0000000000000000
snd_soc_sst_acpi 13007 0 - Live 0x0000000000000000
8250_dw 13474 0 - Live 0x0000000000000000
hid_generic 12559 0 - Live 0x0000000000000000
usbhid 53155 0 - Live 0x0000000000000000
hid 110572 4 i2c_hid,hid_generic,usbhid, Live 0x0000000000000000
rtsx_pci_sdmmc 23718 0 - Live 0x0000000000000000
r8169 86907 0 - Live 0x0000000000000000
mii 13981 1 r8169, Live 0x0000000000000000
psmouse 118117 0 - Live 0x0000000000000000
ahci 34220 3 - Live 0x0000000000000000
libahci 32446 1 ahci, Live 0x0000000000000000
rtsx_pci 51162 2 rtsx_pci_ms,rtsx_pci_sdmmc, Live 0x0000000000000000
sdhci_acpi 13502 0 - Live 0x0000000000000000
sdhci 43929 1 sdhci_acpi, Live 0x0000000000000000

[7.4.] Loaded driver and hardware information
 cat /proc/ioports
0000-0cf7 : PCI Bus 0000:00
  0000-001f : dma1
  0020-0021 : pic1
  0040-0043 : timer0
  0050-0053 : timer1
  0060-0060 : keyboard
  0062-0062 : PNP0C09:00
    0062-0062 : EC data
  0064-0064 : keyboard
  0066-0066 : PNP0C09:00
    0066-0066 : EC cmd
  0070-0077 : rtc0
  0080-008f : dma page reg
  00a0-00a1 : pic2
  00c0-00df : dma2
  00f0-00ff : fpu
  0240-0259 : pnp 00:05
  04d0-04d1 : pnp 00:04
  0680-069f : pnp 00:01
0cf8-0cff : PCI conf1
0d00-ffff : PCI Bus 0000:00
  164e-164f : pnp 00:01
  1800-1803 : ACPI PM1a_EVT_BLK
  1804-1805 : ACPI PM1a_CNT_BLK
  1808-180b : ACPI PM_TMR
  1810-1815 : ACPI CPU throttle
  1830-1833 : iTCO_wdt
  1850-1850 : ACPI PM2_CNT_BLK
  1854-1857 : pnp 00:03
  1860-187f : iTCO_wdt
  1880-189f : ACPI GPE0_BLK
  1c00-1cfe : pnp 00:01
  1d00-1dfe : pnp 00:01
  1e00-1efe : pnp 00:01
  1f00-1ffe : pnp 00:01
  e000-efff : PCI Bus 0000:02
    e000-e0ff : 0000:02:00.1
      e000-e0ff : r8169
  f000-f03f : 0000:00:02.0
  f040-f05f : 0000:00:1f.3
  f060-f07f : 0000:00:1f.2
    f060-f07f : ahci
  f080-f083 : 0000:00:1f.2
    f080-f083 : ahci
  f090-f097 : 0000:00:1f.2
    f090-f097 : ahci
  f0a0-f0a3 : 0000:00:1f.2
    f0a0-f0a3 : ahci
  f0b0-f0b7 : 0000:00:1f.2
    f0b0-f0b7 : ahci
  ffff-ffff : pnp 00:01
    ffff-ffff : pnp 00:01
      ffff-ffff : pnp 00:01

$ cat /proc/iomem
00000000-00000fff : reserved
00001000-00057fff : System RAM
00058000-00058fff : reserved
00059000-0009efff : System RAM
0009f000-0009ffff : reserved
000a0000-000bffff : PCI Bus 0000:00
000c0000-000cebff : Video ROM
000d0000-000d3fff : PCI Bus 0000:00
000d4000-000d7fff : PCI Bus 0000:00
000d8000-000dbfff : PCI Bus 0000:00
000dc000-000dffff : PCI Bus 0000:00
000f0000-000fffff : System ROM
00100000-c9b27fff : System RAM
  02000000-027b1c17 : Kernel code
  027b1c18-02d19c7f : Kernel data
  02e80000-02fc8fff : Kernel bss
c9b28000-c9b2efff : ACPI Non-volatile Storage
c9b2f000-ca365fff : System RAM
ca366000-ca5cdfff : reserved
ca5ce000-d993dfff : System RAM
d993e000-d9b45fff : reserved
d9b46000-d9e82fff : System RAM
d9e83000-dab4cfff : ACPI Non-volatile Storage
dab4d000-daf59fff : reserved
daf5a000-daffefff : reserved
dafff000-daffffff : System RAM
db000000-dbbfffff : RAM buffer
dbc00000-dfdfffff : reserved
  dbe00000-dfdfffff : Graphics Stolen Memory
dfe00000-feafffff : PCI Bus 0000:00
  e0000000-efffffff : 0000:00:02.0
  f7800000-f7bfffff : 0000:00:02.0
  f7c00000-f7cfffff : PCI Bus 0000:03
    f7c00000-f7c7ffff : 0000:03:00.0
      f7c00000-f7c7ffff : ath9k
    f7c80000-f7c8ffff : 0000:03:00.0
  f7d00000-f7dfffff : PCI Bus 0000:02
    f7d00000-f7d0ffff : 0000:02:00.0
    f7d10000-f7d13fff : 0000:02:00.1
      f7d10000-f7d13fff : r8169
    f7d14000-f7d14fff : 0000:02:00.1
      f7d14000-f7d14fff : r8169
    f7d15000-f7d15fff : 0000:02:00.0
      f7d15000-f7d15fff : rtsx_pci
  f7e00000-f7e0ffff : 0000:00:14.0
    f7e00000-f7e0ffff : xhci-hcd
  f7e10000-f7e17fff : 0000:00:04.0
  f7e18000-f7e1bfff : 0000:00:1b.0
    f7e18000-f7e1bfff : ICH HD audio
  f7e1c000-f7e1ffff : 0000:00:03.0
    f7e1c000-f7e1ffff : ICH HD audio
  f7e20000-f7e20fff : 0000:00:1f.6
  f7e21000-f7e210ff : 0000:00:1f.3
  f7e22000-f7e227ff : 0000:00:1f.2
    f7e22000-f7e227ff : ahci
  f7e23000-f7e233ff : 0000:00:1d.0
    f7e23000-f7e233ff : ehci_hcd
  f7e25000-f7e2501f : 0000:00:16.0
    f7e25000-f7e2501f : mei_me
  f7fdf000-f7fdffff : pnp 00:09
  f7fe0000-f7feffff : pnp 00:09
  f8000000-fbffffff : PCI MMCONFIG 0000 [bus 00-3f]
    f8000000-fbffffff : reserved
      f8000000-fbffffff : pnp 00:09
fec00000-fec00fff : reserved
  fec00000-fec003ff : IOAPIC 0
fed00000-fed03fff : reserved
  fed00000-fed003ff : HPET 0
    fed00000-fed003ff : PNP0103:00
fed10000-fed17fff : pnp 00:09
fed18000-fed18fff : pnp 00:09
fed19000-fed19fff : pnp 00:09
fed1c000-fed1ffff : reserved
  fed1c000-fed1ffff : pnp 00:09
    fed1f410-fed1f414 : iTCO_wdt
fed20000-fed3ffff : pnp 00:09
fed40000-fed44fff : pnp 00:00
fed45000-fed8ffff : pnp 00:09
fed90000-fed93fff : pnp 00:09
fee00000-fee00fff : Local APIC
  fee00000-fee00fff : reserved
ff000000-ffffffff : reserved
  ff000000-ffffffff : INT0800:00
    ff000000-ffffffff : pnp 00:09
100000000-21f1fffff : System RAM
21f200000-21fffffff : RAM buffer

[7.5.] PCI information
$ sudo lspci -vvv
[sudo] password for luca:
00:00.0 Host bridge: Intel Corporation Haswell-ULT DRAM Controller (rev 09)
    Subsystem: ASUSTeK Computer Inc. Device 15ad
    Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
ParErr- Stepping- SERR- FastB2B- DisINTx-
    Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=fast >TAbort-
<TAbort- <MAbort+ >SERR- <PERR- INTx-
    Latency: 0
    Capabilities: [e0] Vendor Specific Information: Len=0c <?>

00:02.0 VGA compatible controller: Intel Corporation Haswell-ULT
Integrated Graphics Controller (rev 09) (prog-if 00 [VGA controller])
    Subsystem: ASUSTeK Computer Inc. Device 15ad
    Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
ParErr- Stepping- SERR- FastB2B- DisINTx+
    Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=fast >TAbort-
<TAbort- <MAbort- >SERR- <PERR- INTx-
    Latency: 0
    Interrupt: pin A routed to IRQ 46
    Region 0: Memory at f7800000 (64-bit, non-prefetchable) [size=4M]
    Region 2: Memory at e0000000 (64-bit, prefetchable) [size=256M]
    Region 4: I/O ports at f000 [size=64]
    Expansion ROM at <unassigned> [disabled]
    Capabilities: [90] MSI: Enable+ Count=1/1 Maskable- 64bit-
        Address: fee0f00c  Data: 4152
    Capabilities: [d0] Power Management version 2
        Flags: PMEClk- DSI+ D1- D2- AuxCurrent=0mA
PME(D0-,D1-,D2-,D3hot-,D3cold-)
        Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
    Capabilities: [a4] PCI Advanced Features
        AFCap: TP+ FLR+
        AFCtrl: FLR-
        AFStatus: TP-
    Kernel driver in use: i915

00:03.0 Audio device: Intel Corporation Haswell-ULT HD Audio Controller (rev 09)
    Subsystem: ASUSTeK Computer Inc. Device 15ad
    Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
ParErr- Stepping- SERR- FastB2B- DisINTx+
    Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort-
<TAbort- <MAbort- >SERR- <PERR- INTx-
    Latency: 0, Cache Line Size: 64 bytes
    Interrupt: pin A routed to IRQ 47
    Region 0: Memory at f7e1c000 (64-bit, non-prefetchable) [size=16K]
    Capabilities: [50] Power Management version 2
        Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA
PME(D0-,D1-,D2-,D3hot-,D3cold-)
        Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
    Capabilities: [60] MSI: Enable+ Count=1/1 Maskable- 64bit-
        Address: fee0f00c  Data: 4162
    Capabilities: [70] Express (v1) Root Complex Integrated Endpoint, MSI 00
        DevCap:    MaxPayload 128 bytes, PhantFunc 0
            ExtTag- RBE-
        DevCtl:    Report errors: Correctable- Non-Fatal- Fatal- Unsupported-
            RlxdOrd- ExtTag- PhantFunc- AuxPwr- NoSnoop-
            MaxPayload 128 bytes, MaxReadReq 128 bytes
        DevSta:    CorrErr- UncorrErr- FatalErr- UnsuppReq- AuxPwr- TransPend-
    Kernel driver in use: snd_hda_intel

00:04.0 Signal processing controller: Intel Corporation Device 0a03 (rev 09)
    Subsystem: Intel Corporation Device 2010
    Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
ParErr- Stepping- SERR- FastB2B- DisINTx-
    Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=fast >TAbort-
<TAbort- <MAbort- >SERR- <PERR- INTx-
    Latency: 0
    Interrupt: pin A routed to IRQ 11
    Region 0: Memory at f7e10000 (64-bit, non-prefetchable) [size=32K]
    Capabilities: [90] MSI: Enable- Count=1/1 Maskable- 64bit-
        Address: 00000000  Data: 0000
    Capabilities: [d0] Power Management version 3
        Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA
PME(D0-,D1-,D2-,D3hot-,D3cold-)
        Status: D0 NoSoftRst+ PME-Enable- DSel=0 DScale=0 PME-
    Capabilities: [e0] Vendor Specific Information: Len=0c <?>

00:14.0 USB controller: Intel Corporation Lynx Point-LP USB xHCI HC
(rev 04) (prog-if 30 [XHCI])
    Subsystem: ASUSTeK Computer Inc. Device 201f
    Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
ParErr- Stepping- SERR- FastB2B- DisINTx+
    Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort-
<TAbort- <MAbort- >SERR- <PERR- INTx-
    Latency: 0
    Interrupt: pin A routed to IRQ 40
    Region 0: Memory at f7e00000 (64-bit, non-prefetchable) [size=64K]
    Capabilities: [70] Power Management version 2
        Flags: PMEClk- DSI- D1- D2- AuxCurrent=375mA
PME(D0-,D1-,D2-,D3hot+,D3cold+)
        Status: D0 NoSoftRst+ PME-Enable- DSel=0 DScale=0 PME-
    Capabilities: [80] MSI: Enable+ Count=1/8 Maskable- 64bit+
        Address: 00000000fee0a00c  Data: 4191
    Kernel driver in use: xhci_hcd

00:16.0 Communication controller: Intel Corporation Lynx Point-LP HECI
#0 (rev 04)
    Subsystem: ASUSTeK Computer Inc. Device 15ad
    Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
ParErr- Stepping- SERR- FastB2B- DisINTx+
    Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort-
<TAbort- <MAbort- >SERR- <PERR- INTx-
    Latency: 0
    Interrupt: pin A routed to IRQ 44
    Region 0: Memory at f7e25000 (64-bit, non-prefetchable) [size=32]
    Capabilities: [50] Power Management version 3
        Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA
PME(D0+,D1-,D2-,D3hot+,D3cold+)
        Status: D0 NoSoftRst+ PME-Enable- DSel=0 DScale=0 PME-
    Capabilities: [8c] MSI: Enable+ Count=1/1 Maskable- 64bit+
        Address: 00000000fee0f00c  Data: 41e1
    Kernel driver in use: mei_me

00:1b.0 Audio device: Intel Corporation Lynx Point-LP HD Audio
Controller (rev 04)
    Subsystem: ASUSTeK Computer Inc. Device 15ad
    Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
ParErr- Stepping- SERR- FastB2B- DisINTx+
    Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort-
<TAbort- <MAbort- >SERR- <PERR- INTx-
    Latency: 0, Cache Line Size: 64 bytes
    Interrupt: pin A routed to IRQ 45
    Region 0: Memory at f7e18000 (64-bit, non-prefetchable) [size=16K]
    Capabilities: [50] Power Management version 3
        Flags: PMEClk- DSI- D1- D2- AuxCurrent=55mA
PME(D0+,D1-,D2-,D3hot+,D3cold+)
        Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
    Capabilities: [60] MSI: Enable+ Count=1/1 Maskable- 64bit+
        Address: 00000000fee0f00c  Data: 4142
    Capabilities: [70] Express (v1) Root Complex Integrated Endpoint, MSI 00
        DevCap:    MaxPayload 128 bytes, PhantFunc 0
            ExtTag- RBE-
        DevCtl:    Report errors: Correctable- Non-Fatal- Fatal- Unsupported-
            RlxdOrd- ExtTag- PhantFunc- AuxPwr- NoSnoop-
            MaxPayload 128 bytes, MaxReadReq 128 bytes
        DevSta:    CorrErr- UncorrErr- FatalErr- UnsuppReq- AuxPwr+ TransPend-
    Capabilities: [100 v1] Virtual Channel
        Caps:    LPEVC=0 RefClk=100ns PATEntryBits=1
        Arb:    Fixed- WRR32- WRR64- WRR128-
        Ctrl:    ArbSelect=Fixed
        Status:    InProgress-
        VC0:    Caps:    PATOffset=00 MaxTimeSlots=1 RejSnoopTrans-
            Arb:    Fixed- WRR32- WRR64- WRR128- TWRR128- WRR256-
            Ctrl:    Enable+ ID=0 ArbSelect=Fixed TC/VC=01
            Status:    NegoPending- InProgress-
        VC1:    Caps:    PATOffset=00 MaxTimeSlots=1 RejSnoopTrans-
            Arb:    Fixed- WRR32- WRR64- WRR128- TWRR128- WRR256-
            Ctrl:    Enable- ID=2 ArbSelect=Fixed TC/VC=04
            Status:    NegoPending- InProgress-
    Kernel driver in use: snd_hda_intel

00:1c.0 PCI bridge: Intel Corporation Lynx Point-LP PCI Express Root
Port 1 (rev e4) (prog-if 00 [Normal decode])
    Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
ParErr- Stepping- SERR- FastB2B- DisINTx-
    Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort-
<TAbort- <MAbort- >SERR- <PERR- INTx-
    Latency: 0, Cache Line Size: 64 bytes
    Bus: primary=00, secondary=01, subordinate=01, sec-latency=0
    I/O behind bridge: 0000f000-00000fff
    Memory behind bridge: fff00000-000fffff
    Prefetchable memory behind bridge: 00000000fff00000-00000000000fffff
    Secondary status: 66MHz- FastB2B- ParErr- DEVSEL=fast >TAbort-
<TAbort- <MAbort+ <SERR- <PERR-
    BridgeCtl: Parity- SERR- NoISA- VGA- MAbort- >Reset- FastB2B-
        PriDiscTmr- SecDiscTmr- DiscTmrStat- DiscTmrSERREn-
    Capabilities: [40] Express (v2) Root Port (Slot-), MSI 00
        DevCap:    MaxPayload 128 bytes, PhantFunc 0
            ExtTag- RBE+
        DevCtl:    Report errors: Correctable- Non-Fatal- Fatal- Unsupported-
            RlxdOrd- ExtTag- PhantFunc- AuxPwr- NoSnoop-
            MaxPayload 128 bytes, MaxReadReq 128 bytes
        DevSta:    CorrErr- UncorrErr- FatalErr- UnsuppReq- AuxPwr+ TransPend-
        LnkCap:    Port #1, Speed 5GT/s, Width x1, ASPM L0s L1, Exit
Latency L0s <1us, L1 <4us
            ClockPM- Surprise- LLActRep+ BwNot+
        LnkCtl:    ASPM L0s L1 Enabled; RCB 64 bytes Disabled- CommClk-
            ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
        LnkSta:    Speed 2.5GT/s, Width x0, TrErr- Train- SlotClk+
DLActive- BWMgmt- ABWMgmt-
        RootCtl: ErrCorrectable- ErrNon-Fatal- ErrFatal- PMEIntEna- CRSVisible-
        RootCap: CRSVisible-
        RootSta: PME ReqID 0000, PMEStatus- PMEPending-
        DevCap2: Completion Timeout: Range ABC, TimeoutDis+, LTR+,
OBFF Via WAKE# ARIFwd-
        DevCtl2: Completion Timeout: 50us to 50ms, TimeoutDis-, LTR+,
OBFF Disabled ARIFwd-
        LnkCtl2: Target Link Speed: 5GT/s, EnterCompliance- SpeedDis-
             Transmit Margin: Normal Operating Range,
EnterModifiedCompliance- ComplianceSOS-
             Compliance De-emphasis: -6dB
        LnkSta2: Current De-emphasis Level: -3.5dB,
EqualizationComplete-, EqualizationPhase1-
             EqualizationPhase2-, EqualizationPhase3-, LinkEqualizationRequest-
    Capabilities: [80] MSI: Enable- Count=1/1 Maskable- 64bit-
        Address: 00000000  Data: 0000
    Capabilities: [90] Subsystem: ASUSTeK Computer Inc. Device 15ad
    Capabilities: [a0] Power Management version 3
        Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA
PME(D0+,D1-,D2-,D3hot+,D3cold+)
        Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
    Kernel driver in use: pcieport

00:1c.2 PCI bridge: Intel Corporation Lynx Point-LP PCI Express Root
Port 3 (rev e4) (prog-if 00 [Normal decode])
    Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
ParErr- Stepping- SERR- FastB2B- DisINTx-
    Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort-
<TAbort- <MAbort- >SERR- <PERR- INTx-
    Latency: 0, Cache Line Size: 64 bytes
    Bus: primary=00, secondary=02, subordinate=02, sec-latency=0
    I/O behind bridge: 0000e000-0000efff
    Memory behind bridge: f7d00000-f7dfffff
    Prefetchable memory behind bridge: 00000000fff00000-00000000000fffff
    Secondary status: 66MHz- FastB2B- ParErr- DEVSEL=fast >TAbort-
<TAbort- <MAbort+ <SERR- <PERR-
    BridgeCtl: Parity- SERR- NoISA- VGA- MAbort- >Reset- FastB2B-
        PriDiscTmr- SecDiscTmr- DiscTmrStat- DiscTmrSERREn-
    Capabilities: [40] Express (v2) Root Port (Slot+), MSI 00
        DevCap:    MaxPayload 128 bytes, PhantFunc 0
            ExtTag- RBE+
        DevCtl:    Report errors: Correctable- Non-Fatal- Fatal- Unsupported-
            RlxdOrd- ExtTag- PhantFunc- AuxPwr- NoSnoop-
            MaxPayload 128 bytes, MaxReadReq 128 bytes
        DevSta:    CorrErr- UncorrErr- FatalErr- UnsuppReq- AuxPwr+ TransPend-
        LnkCap:    Port #3, Speed 5GT/s, Width x1, ASPM L0s L1, Exit
Latency L0s <512ns, L1 <16us
            ClockPM- Surprise- LLActRep+ BwNot+
        LnkCtl:    ASPM Disabled; RCB 64 bytes Disabled- CommClk+
            ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
        LnkSta:    Speed 2.5GT/s, Width x1, TrErr- Train- SlotClk+
DLActive+ BWMgmt+ ABWMgmt-
        SltCap:    AttnBtn- PwrCtrl- MRL- AttnInd- PwrInd- HotPlug- Surprise-
            Slot #2, PowerLimit 10.000W; Interlock- NoCompl+
        SltCtl:    Enable: AttnBtn- PwrFlt- MRL- PresDet- CmdCplt-
HPIrq- LinkChg-
            Control: AttnInd Unknown, PwrInd Unknown, Power- Interlock-
        SltSta:    Status: AttnBtn- PowerFlt- MRL- CmdCplt- PresDet+ Interlock-
            Changed: MRL- PresDet- LinkState-
        RootCtl: ErrCorrectable- ErrNon-Fatal- ErrFatal- PMEIntEna- CRSVisible-
        RootCap: CRSVisible-
        RootSta: PME ReqID 0000, PMEStatus- PMEPending-
        DevCap2: Completion Timeout: Range ABC, TimeoutDis+, LTR+,
OBFF Not Supported ARIFwd-
        DevCtl2: Completion Timeout: 50us to 50ms, TimeoutDis-, LTR+,
OBFF Disabled ARIFwd-
        LnkCtl2: Target Link Speed: 5GT/s, EnterCompliance- SpeedDis-
             Transmit Margin: Normal Operating Range,
EnterModifiedCompliance- ComplianceSOS-
             Compliance De-emphasis: -6dB
        LnkSta2: Current De-emphasis Level: -3.5dB,
EqualizationComplete-, EqualizationPhase1-
             EqualizationPhase2-, EqualizationPhase3-, LinkEqualizationRequest-
    Capabilities: [80] MSI: Enable- Count=1/1 Maskable- 64bit-
        Address: 00000000  Data: 0000
    Capabilities: [90] Subsystem: ASUSTeK Computer Inc. Device 15ad
    Capabilities: [a0] Power Management version 3
        Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA
PME(D0+,D1-,D2-,D3hot+,D3cold+)
        Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
    Capabilities: [100 v0] #00
    Capabilities: [200 v1] L1 PM Substates
        L1SubCap: PCI-PM_L1.2+ PCI-PM_L1.1+ ASPM_L1.2+ ASPM_L1.1+
L1_PM_Substates+
              PortCommonModeRestoreTime=40us PortTPowerOnTime=10us
    Kernel driver in use: pcieport

00:1c.3 PCI bridge: Intel Corporation Lynx Point-LP PCI Express Root
Port 4 (rev e4) (prog-if 00 [Normal decode])
    Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
ParErr- Stepping- SERR- FastB2B- DisINTx-
    Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort-
<TAbort- <MAbort- >SERR- <PERR- INTx-
    Latency: 0, Cache Line Size: 64 bytes
    Bus: primary=00, secondary=03, subordinate=03, sec-latency=0
    I/O behind bridge: 0000f000-00000fff
    Memory behind bridge: f7c00000-f7cfffff
    Prefetchable memory behind bridge: 00000000fff00000-00000000000fffff
    Secondary status: 66MHz- FastB2B- ParErr- DEVSEL=fast >TAbort-
<TAbort- <MAbort+ <SERR- <PERR-
    BridgeCtl: Parity- SERR- NoISA- VGA- MAbort- >Reset- FastB2B-
        PriDiscTmr- SecDiscTmr- DiscTmrStat- DiscTmrSERREn-
    Capabilities: [40] Express (v2) Root Port (Slot+), MSI 00
        DevCap:    MaxPayload 128 bytes, PhantFunc 0
            ExtTag- RBE+
        DevCtl:    Report errors: Correctable- Non-Fatal- Fatal- Unsupported-
            RlxdOrd- ExtTag- PhantFunc- AuxPwr- NoSnoop-
            MaxPayload 128 bytes, MaxReadReq 128 bytes
        DevSta:    CorrErr- UncorrErr- FatalErr- UnsuppReq- AuxPwr+ TransPend-
        LnkCap:    Port #4, Speed 5GT/s, Width x1, ASPM L0s L1, Exit
Latency L0s <512ns, L1 <16us
            ClockPM- Surprise- LLActRep+ BwNot+
        LnkCtl:    ASPM Disabled; RCB 64 bytes Disabled- CommClk+
            ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
        LnkSta:    Speed 2.5GT/s, Width x1, TrErr- Train- SlotClk+
DLActive+ BWMgmt+ ABWMgmt-
        SltCap:    AttnBtn- PwrCtrl- MRL- AttnInd- PwrInd- HotPlug- Surprise-
            Slot #3, PowerLimit 10.000W; Interlock- NoCompl+
        SltCtl:    Enable: AttnBtn- PwrFlt- MRL- PresDet- CmdCplt-
HPIrq- LinkChg-
            Control: AttnInd Unknown, PwrInd Unknown, Power- Interlock-
        SltSta:    Status: AttnBtn- PowerFlt- MRL- CmdCplt- PresDet+ Interlock-
            Changed: MRL- PresDet- LinkState-
        RootCtl: ErrCorrectable- ErrNon-Fatal- ErrFatal- PMEIntEna- CRSVisible-
        RootCap: CRSVisible-
        RootSta: PME ReqID 0000, PMEStatus- PMEPending-
        DevCap2: Completion Timeout: Range ABC, TimeoutDis+, LTR+,
OBFF Not Supported ARIFwd-
        DevCtl2: Completion Timeout: 50us to 50ms, TimeoutDis-, LTR+,
OBFF Disabled ARIFwd-
        LnkCtl2: Target Link Speed: 5GT/s, EnterCompliance- SpeedDis-
             Transmit Margin: Normal Operating Range,
EnterModifiedCompliance- ComplianceSOS-
             Compliance De-emphasis: -6dB
        LnkSta2: Current De-emphasis Level: -3.5dB,
EqualizationComplete-, EqualizationPhase1-
             EqualizationPhase2-, EqualizationPhase3-, LinkEqualizationRequest-
    Capabilities: [80] MSI: Enable- Count=1/1 Maskable- 64bit-
        Address: 00000000  Data: 0000
    Capabilities: [90] Subsystem: ASUSTeK Computer Inc. Device 15ad
    Capabilities: [a0] Power Management version 3
        Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA
PME(D0+,D1-,D2-,D3hot+,D3cold+)
        Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
    Capabilities: [100 v0] #00
    Capabilities: [200 v1] L1 PM Substates
        L1SubCap: PCI-PM_L1.2+ PCI-PM_L1.1+ ASPM_L1.2+ ASPM_L1.1+
L1_PM_Substates+
              PortCommonModeRestoreTime=40us PortTPowerOnTime=10us
    Kernel driver in use: pcieport

00:1d.0 USB controller: Intel Corporation Lynx Point-LP USB EHCI #1
(rev 04) (prog-if 20 [EHCI])
    Subsystem: ASUSTeK Computer Inc. Device 201f
    Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
ParErr- Stepping- SERR- FastB2B- DisINTx-
    Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort-
<TAbort- <MAbort- >SERR- <PERR- INTx-
    Latency: 0
    Interrupt: pin A routed to IRQ 23
    Region 0: Memory at f7e23000 (32-bit, non-prefetchable) [size=1K]
    Capabilities: [50] Power Management version 3
        Flags: PMEClk- DSI- D1- D2- AuxCurrent=375mA
PME(D0+,D1-,D2-,D3hot+,D3cold+)
        Status: D0 NoSoftRst+ PME-Enable- DSel=0 DScale=0 PME-
    Capabilities: [58] Debug port: BAR=1 offset=00a0
    Capabilities: [98] PCI Advanced Features
        AFCap: TP+ FLR+
        AFCtrl: FLR-
        AFStatus: TP-
    Kernel driver in use: ehci-pci

00:1f.0 ISA bridge: Intel Corporation Lynx Point-LP LPC Controller (rev 04)
    Subsystem: ASUSTeK Computer Inc. Device 15ad
    Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
ParErr- Stepping- SERR- FastB2B- DisINTx-
    Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort-
<TAbort- <MAbort- >SERR- <PERR- INTx-
    Latency: 0
    Capabilities: [e0] Vendor Specific Information: Len=0c <?>
    Kernel driver in use: lpc_ich

00:1f.2 SATA controller: Intel Corporation Lynx Point-LP SATA
Controller 1 [AHCI mode] (rev 04) (prog-if 01 [AHCI 1.0])
    Subsystem: ASUSTeK Computer Inc. Device 15ad
    Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
ParErr- Stepping- SERR- FastB2B- DisINTx+
    Status: Cap+ 66MHz+ UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort-
<TAbort- <MAbort- >SERR- <PERR- INTx-
    Latency: 0
    Interrupt: pin B routed to IRQ 42
    Region 0: I/O ports at f0b0 [size=8]
    Region 1: I/O ports at f0a0 [size=4]
    Region 2: I/O ports at f090 [size=8]
    Region 3: I/O ports at f080 [size=4]
    Region 4: I/O ports at f060 [size=32]
    Region 5: Memory at f7e22000 (32-bit, non-prefetchable) [size=2K]
    Capabilities: [80] MSI: Enable+ Count=1/1 Maskable- 64bit-
        Address: fee0a00c  Data: 41c1
    Capabilities: [70] Power Management version 3
        Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA
PME(D0-,D1-,D2-,D3hot+,D3cold-)
        Status: D0 NoSoftRst+ PME-Enable- DSel=0 DScale=0 PME-
    Capabilities: [a8] SATA HBA v1.0 BAR4 Offset=00000004
    Kernel driver in use: ahci

00:1f.3 SMBus: Intel Corporation Lynx Point-LP SMBus Controller (rev 04)
    Subsystem: ASUSTeK Computer Inc. Device 15ad
    Control: I/O+ Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop-
ParErr- Stepping- SERR- FastB2B- DisINTx-
    Status: Cap- 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort-
<TAbort- <MAbort- >SERR- <PERR- INTx-
    Interrupt: pin C routed to IRQ 3
    Region 0: Memory at f7e21000 (64-bit, non-prefetchable) [size=256]
    Region 4: I/O ports at f040 [size=32]

00:1f.6 Signal processing controller: Intel Corporation Lynx Point-LP
Thermal (rev 04)
    Subsystem: ASUSTeK Computer Inc. Device 15ad
    Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
ParErr- Stepping- SERR- FastB2B- DisINTx-
    Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort-
<TAbort- <MAbort- >SERR- <PERR- INTx-
    Latency: 0
    Interrupt: pin C routed to IRQ 3
    Region 0: Memory at f7e20000 (64-bit, non-prefetchable) [size=4K]
    Capabilities: [50] Power Management version 3
        Flags: PMEClk- DSI+ D1- D2- AuxCurrent=0mA
PME(D0-,D1-,D2-,D3hot-,D3cold-)
        Status: D0 NoSoftRst+ PME-Enable- DSel=0 DScale=0 PME-
    Capabilities: [80] MSI: Enable- Count=1/1 Maskable- 64bit-
        Address: 00000000  Data: 0000

02:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd.
Device 5287 (rev 01)
    Subsystem: ASUSTeK Computer Inc. Device 202f
    Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
ParErr- Stepping- SERR- FastB2B- DisINTx+
    Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort-
<TAbort- <MAbort- >SERR- <PERR- INTx-
    Latency: 0, Cache Line Size: 64 bytes
    Interrupt: pin B routed to IRQ 41
    Region 0: Memory at f7d15000 (32-bit, non-prefetchable) [size=4K]
    Expansion ROM at f7d00000 [disabled] [size=64K]
    Capabilities: [40] Power Management version 3
        Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=375mA
PME(D0-,D1+,D2+,D3hot+,D3cold+)
        Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
    Capabilities: [50] MSI: Enable+ Count=1/1 Maskable- 64bit+
        Address: 00000000fee0f00c  Data: 41b1
    Capabilities: [70] Express (v2) Endpoint, MSI 00
        DevCap:    MaxPayload 128 bytes, PhantFunc 0, Latency L0s
<512ns, L1 <64us
            ExtTag- AttnBtn- AttnInd- PwrInd- RBE+ FLReset-
        DevCtl:    Report errors: Correctable- Non-Fatal- Fatal- Unsupported-
            RlxdOrd- ExtTag- PhantFunc- AuxPwr- NoSnoop-
            MaxPayload 128 bytes, MaxReadReq 512 bytes
        DevSta:    CorrErr+ UncorrErr- FatalErr- UnsuppReq+ AuxPwr+ TransPend-
        LnkCap:    Port #0, Speed 2.5GT/s, Width x1, ASPM L0s L1, Exit
Latency L0s unlimited, L1 <64us
            ClockPM+ Surprise- LLActRep- BwNot-
        LnkCtl:    ASPM L1 Enabled; RCB 64 bytes Disabled- CommClk-
            ExtSynch- ClockPM+ AutWidDis- BWInt- AutBWInt-
        LnkSta:    Speed 2.5GT/s, Width x1, TrErr- Train- SlotClk+
DLActive- BWMgmt- ABWMgmt-
        DevCap2: Completion Timeout: Range ABCD, TimeoutDis+, LTR+,
OBFF Via message/WAKE#
        DevCtl2: Completion Timeout: 50us to 50ms, TimeoutDis-, LTR+,
OBFF Disabled
        LnkCtl2: Target Link Speed: 2.5GT/s, EnterCompliance- SpeedDis-
             Transmit Margin: Normal Operating Range,
EnterModifiedCompliance- ComplianceSOS-
             Compliance De-emphasis: -6dB
        LnkSta2: Current De-emphasis Level: -6dB,
EqualizationComplete-, EqualizationPhase1-
             EqualizationPhase2-, EqualizationPhase3-, LinkEqualizationRequest-
    Capabilities: [b0] MSI-X: Enable- Count=1 Masked-
        Vector table: BAR=0 offset=00000000
        PBA: BAR=0 offset=00000000
    Capabilities: [d0] Vital Product Data
pcilib: sysfs_read_vpd: read failed: Connection timed out
        Not readable
    Capabilities: [100 v2] Advanced Error Reporting
        UESta:    DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt-
RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
        UEMsk:    DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt-
RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
        UESvrt:    DLP+ SDES+ TLP- FCP+ CmpltTO- CmpltAbrt- UnxCmplt-
RxOF+ MalfTLP+ ECRC- UnsupReq- ACSViol-
        CESta:    RxErr- BadTLP- BadDLLP- Rollover- Timeout- NonFatalErr+
        CEMsk:    RxErr- BadTLP- BadDLLP- Rollover- Timeout- NonFatalErr+
        AERCap:    First Error Pointer: 00, GenCap+ CGenEn- ChkCap+ ChkEn-
    Capabilities: [140 v1] Virtual Channel
        Caps:    LPEVC=0 RefClk=100ns PATEntryBits=1
        Arb:    Fixed- WRR32- WRR64- WRR128-
        Ctrl:    ArbSelect=Fixed
        Status:    InProgress-
        VC0:    Caps:    PATOffset=00 MaxTimeSlots=1 RejSnoopTrans-
            Arb:    Fixed- WRR32- WRR64- WRR128- TWRR128- WRR256-
            Ctrl:    Enable+ ID=0 ArbSelect=Fixed TC/VC=01
            Status:    NegoPending- InProgress-
    Capabilities: [160 v1] Device Serial Number 00-00-00-00-00-00-00-00
    Capabilities: [170 v1] Latency Tolerance Reporting
        Max snoop latency: 3145728ns
        Max no snoop latency: 3145728ns
    Capabilities: [178 v1] L1 PM Substates
        L1SubCap: PCI-PM_L1.2+ PCI-PM_L1.1+ ASPM_L1.2+ ASPM_L1.1+
L1_PM_Substates+
              PortCommonModeRestoreTime=150us PortTPowerOnTime=150us
    Kernel driver in use: rtsx_pci

02:00.1 Ethernet controller: Realtek Semiconductor Co., Ltd.
RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 12)
    Subsystem: ASUSTeK Computer Inc. Device 200f
    Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
ParErr- Stepping- SERR- FastB2B- DisINTx+
    Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort-
<TAbort- <MAbort- >SERR- <PERR- INTx-
    Latency: 0, Cache Line Size: 64 bytes
    Interrupt: pin A routed to IRQ 43
    Region 0: I/O ports at e000 [size=256]
    Region 2: Memory at f7d14000 (64-bit, non-prefetchable) [size=4K]
    Region 4: Memory at f7d10000 (64-bit, non-prefetchable) [size=16K]
    Capabilities: [40] Power Management version 3
        Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=375mA
PME(D0+,D1+,D2+,D3hot+,D3cold+)
        Status: D0 NoSoftRst+ PME-Enable- DSel=0 DScale=0 PME-
    Capabilities: [50] MSI: Enable+ Count=1/1 Maskable- 64bit+
        Address: 00000000fee0100c  Data: 41d1
    Capabilities: [70] Express (v2) Endpoint, MSI 01
        DevCap:    MaxPayload 128 bytes, PhantFunc 0, Latency L0s
<512ns, L1 <64us
            ExtTag- AttnBtn- AttnInd- PwrInd- RBE+ FLReset-
        DevCtl:    Report errors: Correctable- Non-Fatal- Fatal- Unsupported-
            RlxdOrd- ExtTag- PhantFunc- AuxPwr- NoSnoop-
            MaxPayload 128 bytes, MaxReadReq 4096 bytes
        DevSta:    CorrErr+ UncorrErr- FatalErr- UnsuppReq+ AuxPwr+ TransPend-
        LnkCap:    Port #0, Speed 2.5GT/s, Width x1, ASPM L0s L1, Exit
Latency L0s unlimited, L1 <64us
            ClockPM+ Surprise- LLActRep- BwNot-
        LnkCtl:    ASPM Disabled; RCB 64 bytes Disabled- CommClk+
            ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
        LnkSta:    Speed 2.5GT/s, Width x1, TrErr- Train- SlotClk+
DLActive- BWMgmt- ABWMgmt-
        DevCap2: Completion Timeout: Range ABCD, TimeoutDis+, LTR+,
OBFF Via message/WAKE#
        DevCtl2: Completion Timeout: 50us to 50ms, TimeoutDis-, LTR-,
OBFF Disabled
        LnkSta2: Current De-emphasis Level: -6dB,
EqualizationComplete-, EqualizationPhase1-
             EqualizationPhase2-, EqualizationPhase3-, LinkEqualizationRequest-
    Capabilities: [b0] MSI-X: Enable- Count=4 Masked-
        Vector table: BAR=4 offset=00000000
        PBA: BAR=4 offset=00000800
    Capabilities: [d0] Vital Product Data
        Unknown small resource type 00, will not decode more.
    Capabilities: [100 v2] Advanced Error Reporting
        UESta:    DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt-
RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
        UEMsk:    DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt-
RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
        UESvrt:    DLP+ SDES+ TLP- FCP+ CmpltTO- CmpltAbrt- UnxCmplt-
RxOF+ MalfTLP+ ECRC- UnsupReq- ACSViol-
        CESta:    RxErr- BadTLP- BadDLLP- Rollover- Timeout- NonFatalErr+
        CEMsk:    RxErr- BadTLP- BadDLLP- Rollover- Timeout- NonFatalErr+
        AERCap:    First Error Pointer: 00, GenCap+ CGenEn- ChkCap+ ChkEn-
    Capabilities: [160 v1] Device Serial Number 09-25-01-13-68-4c-e0-00
    Capabilities: [170 v1] Latency Tolerance Reporting
        Max snoop latency: 3145728ns
        Max no snoop latency: 3145728ns
    Capabilities: [178 v1] L1 PM Substates
        L1SubCap: PCI-PM_L1.2+ PCI-PM_L1.1+ ASPM_L1.2+ ASPM_L1.1+
L1_PM_Substates+
              PortCommonModeRestoreTime=150us PortTPowerOnTime=150us
    Kernel driver in use: r8169

03:00.0 Network controller: Qualcomm Atheros QCA9565 / AR9565 Wireless
Network Adapter (rev 01)
    Subsystem: AzureWave Device 2130
    Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
ParErr- Stepping- SERR- FastB2B- DisINTx-
    Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort-
<TAbort- <MAbort- >SERR- <PERR- INTx-
    Latency: 0, Cache Line Size: 64 bytes
    Interrupt: pin A routed to IRQ 19
    Region 0: Memory at f7c00000 (64-bit, non-prefetchable) [size=512K]
    Expansion ROM at f7c80000 [disabled] [size=64K]
    Capabilities: [40] Power Management version 2
        Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=375mA
PME(D0+,D1+,D2+,D3hot+,D3cold+)
        Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
    Capabilities: [50] MSI: Enable- Count=1/4 Maskable+ 64bit+
        Address: 0000000000000000  Data: 0000
        Masking: 00000000  Pending: 00000000
    Capabilities: [70] Express (v2) Endpoint, MSI 00
        DevCap:    MaxPayload 128 bytes, PhantFunc 0, Latency L0s
unlimited, L1 <64us
            ExtTag- AttnBtn- AttnInd- PwrInd- RBE+ FLReset-
        DevCtl:    Report errors: Correctable- Non-Fatal- Fatal- Unsupported-
            RlxdOrd- ExtTag- PhantFunc- AuxPwr- NoSnoop-
            MaxPayload 128 bytes, MaxReadReq 512 bytes
        DevSta:    CorrErr+ UncorrErr- FatalErr- UnsuppReq+ AuxPwr+ TransPend-
        LnkCap:    Port #0, Speed 2.5GT/s, Width x1, ASPM L0s L1, Exit
Latency L0s <4us, L1 <64us
            ClockPM- Surprise- LLActRep- BwNot-
        LnkCtl:    ASPM Disabled; RCB 64 bytes Disabled- CommClk+
            ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
        LnkSta:    Speed 2.5GT/s, Width x1, TrErr- Train- SlotClk+
DLActive- BWMgmt- ABWMgmt-
        DevCap2: Completion Timeout: Not Supported, TimeoutDis+, LTR-,
OBFF Not Supported
        DevCtl2: Completion Timeout: 50us to 50ms, TimeoutDis-, LTR-,
OBFF Disabled
        LnkCtl2: Target Link Speed: 2.5GT/s, EnterCompliance- SpeedDis-
             Transmit Margin: Normal Operating Range,
EnterModifiedCompliance- ComplianceSOS-
             Compliance De-emphasis: -6dB
        LnkSta2: Current De-emphasis Level: -6dB,
EqualizationComplete-, EqualizationPhase1-
             EqualizationPhase2-, EqualizationPhase3-, LinkEqualizationRequest-
    Capabilities: [100 v1] Advanced Error Reporting
        UESta:    DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt-
RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
        UEMsk:    DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt-
RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
        UESvrt:    DLP+ SDES+ TLP- FCP+ CmpltTO- CmpltAbrt- UnxCmplt-
RxOF+ MalfTLP+ ECRC- UnsupReq- ACSViol-
        CESta:    RxErr- BadTLP- BadDLLP- Rollover- Timeout- NonFatalErr+
        CEMsk:    RxErr- BadTLP- BadDLLP- Rollover- Timeout- NonFatalErr+
        AERCap:    First Error Pointer: 00, GenCap- CGenEn- ChkCap- ChkEn-
    Capabilities: [140 v1] Virtual Channel
        Caps:    LPEVC=0 RefClk=100ns PATEntryBits=1
        Arb:    Fixed- WRR32- WRR64- WRR128-
        Ctrl:    ArbSelect=Fixed
        Status:    InProgress-
        VC0:    Caps:    PATOffset=00 MaxTimeSlots=1 RejSnoopTrans-
            Arb:    Fixed- WRR32- WRR64- WRR128- TWRR128- WRR256-
            Ctrl:    Enable+ ID=0 ArbSelect=Fixed TC/VC=01
            Status:    NegoPending- InProgress-
    Capabilities: [160 v1] Device Serial Number 00-00-00-00-00-00-00-00
    Kernel driver in use: ath9k

[7.6.] SCSI information
$ cat /proc/scsi/scsi
Attached devices:
Host: scsi0 Channel: 00 Id: 00 Lun: 00
  Vendor: ATA      Model: ST1000LM024 HN-M Rev: 0001
  Type:   Direct-Access                    ANSI  SCSI revision: 05
Host: scsi1 Channel: 00 Id: 00 Lun: 00
  Vendor: TSSTcorp Model: CDDVDW SU-228FB  Rev: AS00
  Type:   CD-ROM                           ANSI  SCSI revision: 05

[7.7.] Other information that might be relevant to the problem
$ ls /proc
1     1301  1495  1573  1830  1957  2114  24    3011  31    3288  3582
 38    43    55    7698  9          devices      kpagecount
slabinfo
10    1311  1499  1574  1832  1958  2119  25    3012  3101  3290  36
 3888  44    581   771   90         diskstats    kpageflags
softirqs
102   1330  15    1580  1851  1961  2130  26    3018  3155  33    3600
 389   45    5883  786   922        dma          loadavg       stat
1053  1342  150   1583  1854  1962  2151  2622  3022  3160  34    361
 39    46    5972  8     975        driver       locks         swaps
1054  1347  1504  1585  1856  1967  22    2651  3025  3163  35    3615
 390   4622  611   802   979        execdomains  mdstat        sys
1055  1361  151   1587  1858  1978  2200  2655  3031  3166  3500  3654
 391   4638  6581  803   986        fb           meminfo
sysrq-trigger
1062  14    152   1596  1859  2     2205  27    3036  3169  3501  3662
 3926  466   665   818   987        filesystems  misc          sysvipc
1065  142   1520  1609  1860  20    2227  2731  304   3176  3503  3676
 3933  468   6663  824   990        fs           modules
thread-self
1084  144   1532  1619  1861  2032  2230  28    3046  3179  3504  3681
 3934  47    6664  829   acpi       interrupts   mounts
timer_list
1088  145   1537  163   1862  2036  2231  29    3048  3185  3506  3687
 396   472   67    835   asound     iomem        mtrr
timer_stats
11    146   1539  1683  1864  2046  2232  2936  3050  3187  3507  3693
 4     473   68    841   buddyinfo  ioports      net           tty
1163  147   1540  1685  1897  2050  2242  2939  3058  32    3515  37
 40    48    69    842   bus        irq          pagetypeinfo  uptime
1180  148   1542  17    19    2059  2244  296   3059  3204  3542  3708
 4065  5     7     864   cgroups    kallsyms     partitions    version
12    1483  1564  172   1906  2063  2248  2991  3061  3223  3554  3728
 41    50    70    870   cmdline    kcore        sched_debug
vmallocinfo
1285  1485  1568  1723  1953  2091  2256  3     3083  3241  3559  375
 42    51    7244  89    consoles   keys         schedstat     vmstat
1288  1486  157   173   1955  2099  2272  3000  3089  3248  3563  3754
 4288  53    7533  893   cpuinfo    key-users    scsi
zoneinfo
13    149   1571  18    1956  21    2355  3004  3095  3281  3575  3790
 4289  54    760   897   crypto     kmsg         self

^ permalink raw reply

* PROBLEM: [HP Stream Notebook - 14-z010nz] Synaptics clickpad incorrectly detected as PS/2 mouse
From: Pascal Fürst @ 2014-11-10 19:59 UTC (permalink / raw)
  To: linux-input

[-- Attachment #1: Type: text/plain, Size: 37446 bytes --]

[1.] One line summary of the problem:
[HP Stream Notebook - 14-z010nz] Synaptics Clickpad incorrectly detected
as PS/2 mouse 

[2.] Full description of the problem/report:
The clickpad acts like and is detected as a standard mouse.

Single-tap to click works, as does the clickpad functionality
(right-click and left-click) and the basic pointing function of a mouse.

Two-finger-scroll, two-finger-tap etc. don't work. The device is not
configurable via the synclient tool. The 'Touchpad' tab in System ->
Preferences -> Mouse is missing.

The clickpad should preferably be recognized as a Synaptics touchpad and
the associated module should be loaded instead of the evdev one. This
would allow to use the features of the synaptics module (especially palm
detection)

Thank you for reading this and for your help


[3.] Keywords (i.e., modules, networking, kernel):

[4.] Kernel version (from /proc/version):
Linux version 3.18.0-031800rc4-generic (apw@gomeisa) (gcc version 4.6.3
(Ubuntu/Linaro 4.6.3-1ubuntu5) ) #201411091835 SMP Sun Nov 9 23:36:36
UTC 2014

[5.] Output of Oops.. message (if applicable) with symbolic information
resolved (see Documentation/oops-tracing.txt)

[6.] A small shell script or example program which triggers the problem
(if possible)

[7.] Environment
Description:	Ubuntu 14.10
Release:	14.10

[7.1.] Software (add the output of the ver_linux script here)
Linux LAPTOP2 3.18.0-031800rc4-generic #201411091835 SMP Sun Nov 9
23:36:36 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
 
Gnu C                  4.9.1
Gnu make               4.0
binutils               2.24.90.20141014
util-linux             2.25.1
mount                  debug
module-init-tools      18
e2fsprogs              1.42.10
pcmciautils            018
PPP                    2.4.5
Linux C Library        2.19
Dynamic linker (ldd)   2.19
Procps                 3.3.9
Net-tools              1.60
Kbd                    1.15.5
Sh-utils               8.23
wireless-tools         30
Modules Loaded         dm_crypt rfcomm bnep kvm crct10dif_pclmul
crc32_pclmul uvcvideo ghash_clmulni_intel hp_wmi aesni_intel
videobuf2_vmalloc sparse_keymap videobuf2_memops aes_x86_64 lrw
videobuf2_core gf128mul btusb glue_helper v4l2_common ablk_helper cryptd
videodev bluetooth snd_hda_codec_realtek snd_hda_codec_generic
snd_hda_codec_hdmi media snd_hda_intel serio_raw snd_hda_controller
edac_core snd_hda_codec binfmt_misc snd_hwdep k10temp edac_mce_amd
fam15h_power snd_seq_midi snd_seq_midi_event snd_pcm ccp snd_rawmidi
shpchp i2c_piix4 snd_seq snd_seq_device snd_timer hp_wireless
nls_iso8859_1 snd soundcore mac_hid parport_pc ppdev lp parport video
radeon i2c_algo_bit ttm psmouse drm_kms_helper ahci wmi sdhci_pci sdhci
drm libahci

[7.2.] Processor information (from /proc/cpuinfo):
processor	: 0
vendor_id	: AuthenticAMD
cpu family	: 22
model		: 48
model name	: AMD A4 Micro-6400T APU + AMD Radeon R3 Graphics
stepping	: 1
microcode	: 0x7030105
cpu MHz		: 1000.000
cache size	: 2048 KB
physical id	: 0
siblings	: 4
core id		: 0
cpu cores	: 4
apicid		: 0
initial apicid	: 0
fpu		: yes
fpu_exception	: yes
cpuid level	: 13
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov
pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt
pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc extd_apicid
aperfmperf eagerfpu pni pclmulqdq monitor ssse3 cx16 sse4_1 sse4_2 movbe
popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic
cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt
topoext perfctr_nb perfctr_l2 arat cpb hw_pstate npt lbrv svm_lock
nrip_save tsc_scale flushbyasid decodeassists pausefilter pfthreshold
vmmcall bmi1 xsaveopt
bugs		: fxsave_leak
bogomips	: 1996.23
TLB size	: 1024 4K pages
clflush size	: 64
cache_alignment	: 64
address sizes	: 40 bits physical, 48 bits virtual
power management: ts ttp tm 100mhzsteps hwpstate cpb [12] [13]

processor	: 1
vendor_id	: AuthenticAMD
cpu family	: 22
model		: 48
model name	: AMD A4 Micro-6400T APU + AMD Radeon R3 Graphics
stepping	: 1
microcode	: 0x7030105
cpu MHz		: 800.000
cache size	: 2048 KB
physical id	: 0
siblings	: 4
core id		: 1
cpu cores	: 4
apicid		: 1
initial apicid	: 1
fpu		: yes
fpu_exception	: yes
cpuid level	: 13
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov
pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt
pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc extd_apicid
aperfmperf eagerfpu pni pclmulqdq monitor ssse3 cx16 sse4_1 sse4_2 movbe
popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic
cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt
topoext perfctr_nb perfctr_l2 arat cpb hw_pstate npt lbrv svm_lock
nrip_save tsc_scale flushbyasid decodeassists pausefilter pfthreshold
vmmcall bmi1 xsaveopt
bugs		: fxsave_leak
bogomips	: 1996.23
TLB size	: 1024 4K pages
clflush size	: 64
cache_alignment	: 64
address sizes	: 40 bits physical, 48 bits virtual
power management: ts ttp tm 100mhzsteps hwpstate cpb [12] [13]

processor	: 2
vendor_id	: AuthenticAMD
cpu family	: 22
model		: 48
model name	: AMD A4 Micro-6400T APU + AMD Radeon R3 Graphics
stepping	: 1
microcode	: 0x7030105
cpu MHz		: 800.000
cache size	: 2048 KB
physical id	: 0
siblings	: 4
core id		: 2
cpu cores	: 4
apicid		: 2
initial apicid	: 2
fpu		: yes
fpu_exception	: yes
cpuid level	: 13
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov
pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt
pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc extd_apicid
aperfmperf eagerfpu pni pclmulqdq monitor ssse3 cx16 sse4_1 sse4_2 movbe
popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic
cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt
topoext perfctr_nb perfctr_l2 arat cpb hw_pstate npt lbrv svm_lock
nrip_save tsc_scale flushbyasid decodeassists pausefilter pfthreshold
vmmcall bmi1 xsaveopt
bugs		: fxsave_leak
bogomips	: 1996.23
TLB size	: 1024 4K pages
clflush size	: 64
cache_alignment	: 64
address sizes	: 40 bits physical, 48 bits virtual
power management: ts ttp tm 100mhzsteps hwpstate cpb [12] [13]

processor	: 3
vendor_id	: AuthenticAMD
cpu family	: 22
model		: 48
model name	: AMD A4 Micro-6400T APU + AMD Radeon R3 Graphics
stepping	: 1
microcode	: 0x7030105
cpu MHz		: 800.000
cache size	: 2048 KB
physical id	: 0
siblings	: 4
core id		: 3
cpu cores	: 4
apicid		: 3
initial apicid	: 3
fpu		: yes
fpu_exception	: yes
cpuid level	: 13
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov
pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt
pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc extd_apicid
aperfmperf eagerfpu pni pclmulqdq monitor ssse3 cx16 sse4_1 sse4_2 movbe
popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic
cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt
topoext perfctr_nb perfctr_l2 arat cpb hw_pstate npt lbrv svm_lock
nrip_save tsc_scale flushbyasid decodeassists pausefilter pfthreshold
vmmcall bmi1 xsaveopt
bugs		: fxsave_leak
bogomips	: 1996.23
TLB size	: 1024 4K pages
clflush size	: 64
cache_alignment	: 64
address sizes	: 40 bits physical, 48 bits virtual
power management: ts ttp tm 100mhzsteps hwpstate cpb [12] [13]


[7.3.] Module information (from /proc/modules):
dm_crypt 23456 0 - Live 0x0000000000000000
rfcomm 75066 8 - Live 0x0000000000000000
bnep 23980 2 - Live 0x0000000000000000
kvm 475233 0 - Live 0x0000000000000000
crct10dif_pclmul 14268 0 - Live 0x0000000000000000
crc32_pclmul 13180 0 - Live 0x0000000000000000
uvcvideo 86723 0 - Live 0x0000000000000000
ghash_clmulni_intel 13230 0 - Live 0x0000000000000000
hp_wmi 14017 0 - Live 0x0000000000000000
aesni_intel 169686 534 - Live 0x0000000000000000
videobuf2_vmalloc 13216 1 uvcvideo, Live 0x0000000000000000
sparse_keymap 13890 1 hp_wmi, Live 0x0000000000000000
videobuf2_memops 13362 1 videobuf2_vmalloc, Live 0x0000000000000000
aes_x86_64 17131 1 aesni_intel, Live 0x0000000000000000
lrw 13323 1 aesni_intel, Live 0x0000000000000000
videobuf2_core 51547 1 uvcvideo, Live 0x0000000000000000
gf128mul 14951 1 lrw, Live 0x0000000000000000
btusb 32691 0 - Live 0x0000000000000000
glue_helper 14095 1 aesni_intel, Live 0x0000000000000000
v4l2_common 15715 1 videobuf2_core, Live 0x0000000000000000
ablk_helper 13597 1 aesni_intel, Live 0x0000000000000000
cryptd 20531 269 ghash_clmulni_intel,aesni_intel,ablk_helper, Live
0x0000000000000000
videodev 163831 3 uvcvideo,videobuf2_core,v4l2_common, Live
0x0000000000000000
bluetooth 486890 22 rfcomm,bnep,btusb, Live 0x0000000000000000
snd_hda_codec_realtek 80418 1 - Live 0x0000000000000000
snd_hda_codec_generic 69995 1 snd_hda_codec_realtek, Live
0x0000000000000000
snd_hda_codec_hdmi 52670 1 - Live 0x0000000000000000
media 22008 2 uvcvideo,videodev, Live 0x0000000000000000
snd_hda_intel 30783 5 - Live 0x0000000000000000
serio_raw 13483 0 - Live 0x0000000000000000
snd_hda_controller 32234 1 snd_hda_intel, Live 0x0000000000000000
edac_core 52405 0 - Live 0x0000000000000000
snd_hda_codec 144641 5
snd_hda_codec_realtek,snd_hda_codec_generic,snd_hda_codec_hdmi,snd_hda_intel,snd_hda_controller, Live 0x0000000000000000
binfmt_misc 17501 1 - Live 0x0000000000000000
snd_hwdep 17709 1 snd_hda_codec, Live 0x0000000000000000
k10temp 13279 0 - Live 0x0000000000000000
edac_mce_amd 22800 0 - Live 0x0000000000000000
fam15h_power 13160 0 - Live 0x0000000000000000
snd_seq_midi 13564 0 - Live 0x0000000000000000
snd_seq_midi_event 14899 1 snd_seq_midi, Live 0x0000000000000000
snd_pcm 106273 4
snd_hda_codec_hdmi,snd_hda_intel,snd_hda_controller,snd_hda_codec, Live
0x0000000000000000
ccp 32275 0 - Live 0x0000000000000000
snd_rawmidi 31197 1 snd_seq_midi, Live 0x0000000000000000
shpchp 37216 0 - Live 0x0000000000000000
i2c_piix4 22311 0 - Live 0x0000000000000000
snd_seq 63540 2 snd_seq_midi,snd_seq_midi_event, Live 0x0000000000000000
snd_seq_device 14497 3 snd_seq_midi,snd_rawmidi,snd_seq, Live
0x0000000000000000
snd_timer 30118 2 snd_pcm,snd_seq, Live 0x0000000000000000
hp_wireless 12637 0 - Live 0x0000000000000000
nls_iso8859_1 12713 1 - Live 0x0000000000000000
snd 84025 21
snd_hda_codec_realtek,snd_hda_codec_generic,snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec,snd_hwdep,snd_pcm,snd_rawmidi,snd_seq,snd_seq_device,snd_timer, Live 0x0000000000000000
soundcore 15091 2 snd_hda_codec,snd, Live 0x0000000000000000
mac_hid 13275 0 - Live 0x0000000000000000
parport_pc 32909 0 - Live 0x0000000000000000
ppdev 17711 0 - Live 0x0000000000000000
lp 17799 0 - Live 0x0000000000000000
parport 42481 3 parport_pc,ppdev,lp, Live 0x0000000000000000
video 20649 0 - Live 0x0000000000000000
radeon 1570939 3 - Live 0x0000000000000000
i2c_algo_bit 13564 1 radeon, Live 0x0000000000000000
ttm 90228 1 radeon, Live 0x0000000000000000
psmouse 118117 0 - Live 0x0000000000000000
drm_kms_helper 99802 1 radeon, Live 0x0000000000000000
ahci 34220 2 - Live 0x0000000000000000
wmi 19379 1 hp_wmi, Live 0x0000000000000000
sdhci_pci 23434 0 - Live 0x0000000000000000
sdhci 43929 1 sdhci_pci, Live 0x0000000000000000
drm 323675 6 radeon,ttm,drm_kms_helper, Live 0x0000000000000000
libahci 32446 1 ahci, Live 0x0000000000000000

[7.4.] Loaded driver and hardware information
(/proc/ioports, /proc/iomem)
cat /proc/ioports
0000-03af : PCI Bus 0000:00
  0000-001f : dma1
  0020-0021 : pic1
  0040-0043 : timer0
  0050-0053 : timer1
  0060-0060 : keyboard
  0061-0061 : PNP0800:00
  0062-0062 : PNP0C09:00
    0062-0062 : EC data
  0064-0064 : keyboard
  0066-0066 : PNP0C09:00
    0066-0066 : EC cmd
  0070-0071 : rtc0
  0080-008f : dma page reg
  00a0-00a1 : pic2
  00c0-00df : dma2
  00f0-00ff : PNP0C04:00
    00f0-00ff : fpu
03b0-03df : PCI Bus 0000:00
03e0-0cf7 : PCI Bus 0000:00
  040b-040b : pnp 00:07
  04d0-04d1 : pnp 00:04
    04d0-04d1 : pnp 00:07
  04d6-04d6 : pnp 00:07
  0800-0803 : ACPI PM1a_EVT_BLK
  0804-0805 : ACPI PM1a_CNT_BLK
  0808-080b : ACPI PM_TMR
  0810-0815 : ACPI CPU throttle
  0820-0827 : ACPI GPE0_BLK
  0900-090f : pnp 00:07
  0910-091f : pnp 00:07
  0b00-0b07 : piix4_smbus
  0b20-0b3f : pnp 00:07
    0b20-0b27 : piix4_smbus
  0c00-0c01 : pnp 00:07
  0c14-0c14 : pnp 00:07
  0c50-0c51 : pnp 00:07
  0c52-0c52 : pnp 00:07
  0c6c-0c6c : pnp 00:07
  0c6f-0c6f : pnp 00:07
  0cd0-0cd1 : pnp 00:07
  0cd2-0cd3 : pnp 00:07
  0cd4-0cd5 : pnp 00:07
  0cd6-0cd7 : pnp 00:07
  0cd8-0cdf : pnp 00:07
0cf8-0cff : PCI conf1
0d00-ffff : PCI Bus 0000:00
  f000-f0ff : 0000:00:01.0
  f100-f10f : 0000:00:11.0
    f100-f10f : ahci
  f110-f113 : 0000:00:11.0
    f110-f113 : ahci
  f120-f127 : 0000:00:11.0
    f120-f127 : ahci
  f130-f133 : 0000:00:11.0
    f130-f133 : ahci
  f140-f147 : 0000:00:11.0
    f140-f147 : ahci
  fe00-fefe : pnp 00:07

cat /proc/iomem
00000000-00000fff : reserved
00001000-0009ffff : System RAM
000a0000-000bffff : PCI Bus 0000:00
000c0000-000dffff : PCI Bus 0000:00
000f0000-000fffff : System ROM
00100000-6cedffff : System RAM
  01000000-017b1c17 : Kernel code
  017b1c18-01d19c7f : Kernel data
  01e80000-01fc8fff : Kernel bss
6cee0000-6cf7bfff : reserved
6cf7c000-6cfb5fff : ACPI Tables
6cfb6000-6d0bcfff : ACPI Non-volatile Storage
6d0bd000-6d793fff : reserved
6d794000-6d7defff : reserved
6d7df000-6d7dffff : System RAM
6d7e0000-6d7e7fff : ACPI Non-volatile Storage
6d7e8000-6dc73fff : System RAM
6dc74000-6dff0fff : reserved
6dff1000-6dffffff : System RAM
6e000000-6fffffff : RAM buffer
7f000000-ffffffff : PCI Bus 0000:00
  c0000000-cfffffff : 0000:00:01.0
  d0000000-d07fffff : 0000:00:01.0
  d0800000-d081ffff : 0000:00:08.0
    d0800000-d081ffff : ccp
  e0000000-efffffff : PCI MMCONFIG 0000 [bus 00-ff]
    e0000000-efffffff : pnp 00:00
  fe800000-fe8fffff : 0000:00:08.0
    fe800000-fe8fffff : ccp
  fe900000-fe9fffff : PCI Bus 0000:01
    fe900000-fe907fff : 0000:01:00.0
  fea00000-fea3ffff : 0000:00:01.0
  fea40000-fea5ffff : 0000:00:01.0
  fea60000-fea63fff : 0000:00:14.2
    fea60000-fea63fff : ICH HD audio
  fea64000-fea67fff : 0000:00:01.1
    fea64000-fea67fff : ICH HD audio
  fea68000-fea69fff : 0000:00:10.0
    fea68000-fea69fff : xhci-hcd
  fea6a000-fea6bfff : 0000:00:08.0
    fea6a000-fea6bfff : ccp
  fea6c000-fea6c0ff : 0000:00:14.7
    fea6c000-fea6c0ff : mmc0
  fea6d000-fea6d0ff : 0000:00:13.0
    fea6d000-fea6d0ff : ehci_hcd
  fea6e000-fea6e0ff : 0000:00:12.0
    fea6e000-fea6e0ff : ehci_hcd
  fea6f000-fea6f3ff : 0000:00:11.0
    fea6f000-fea6f3ff : ahci
  fea70000-fea70fff : 0000:00:08.0
    fea70000-fea70fff : ccp
  feb00000-feb00fff : reserved
  fec00000-fec01fff : reserved
    fec00000-fec003ff : IOAPIC 0
    fec01000-fec013ff : IOAPIC 1
  fec10000-fec10fff : reserved
    fec10000-fec10fff : pnp 00:07
  fed00000-fed00fff : reserved
    fed00000-fed003ff : HPET 0
      fed00000-fed003ff : PNP0103:00
  fed40000-fed44fff : reserved
  fed61000-fed70fff : pnp 00:07
  fed80000-fed8ffff : reserved
    fed80000-fed8ffff : pnp 00:07
  fee00000-fee00fff : Local APIC
    fee00000-fee00fff : pnp 00:07
  ff000000-ffffffff : reserved
    ff000000-ffffffff : pnp 00:07

[7.5.] PCI information ('lspci -vvv' as root)
00:00.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Device 1566
	Subsystem: Hewlett-Packard Company Device 22ea
	Control: I/O- Mem- BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr-
Stepping- SERR- FastB2B- DisINTx-
	Status: Cap- 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort-
<MAbort- >SERR- <PERR- INTx-
	Latency: 0

00:01.0 VGA compatible controller: Advanced Micro Devices, Inc.
[AMD/ATI] Mullins [Radeon R3E Graphics] (rev 02) (prog-if 00 [VGA
controller])
	Subsystem: Hewlett-Packard Company Device 22ea
	Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr-
Stepping- SERR- FastB2B- DisINTx+
	Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort-
<MAbort- >SERR- <PERR- INTx-
	Latency: 0, Cache Line Size: 64 bytes
	Interrupt: pin A routed to IRQ 32
	Region 0: Memory at c0000000 (64-bit, prefetchable) [size=256M]
	Region 2: Memory at d0000000 (64-bit, prefetchable) [size=8M]
	Region 4: I/O ports at f000 [size=256]
	Region 5: Memory at fea00000 (32-bit, non-prefetchable) [size=256K]
	Expansion ROM at fea40000 [disabled] [size=128K]
	Capabilities: [48] Vendor Specific Information: Len=08 <?>
	Capabilities: [50] Power Management version 3
		Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA PME(D0-,D1+,D2+,D3hot
+,D3cold-)
		Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
	Capabilities: [58] Express (v2) Root Complex Integrated Endpoint, MSI
00
		DevCap:	MaxPayload 256 bytes, PhantFunc 0
			ExtTag+ RBE+
		DevCtl:	Report errors: Correctable- Non-Fatal- Fatal- Unsupported-
			RlxdOrd+ ExtTag- PhantFunc- AuxPwr- NoSnoop+
			MaxPayload 128 bytes, MaxReadReq 512 bytes
		DevSta:	CorrErr- UncorrErr- FatalErr- UnsuppReq- AuxPwr- TransPend-
		DevCap2: Completion Timeout: Not Supported, TimeoutDis-, LTR-, OBFF
Not Supported
		DevCtl2: Completion Timeout: 50us to 50ms, TimeoutDis-, LTR-, OBFF
Disabled
	Capabilities: [a0] MSI: Enable+ Count=1/1 Maskable- 64bit+
		Address: 00000000fee0f00c  Data: 4162
	Capabilities: [100 v1] Vendor Specific Information: ID=0001 Rev=1
Len=010 <?>
	Capabilities: [270 v1] #19
	Capabilities: [2b0 v1] Address Translation Service (ATS)
		ATSCap:	Invalidate Queue Depth: 00
		ATSCtl:	Enable-, Smallest Translation Unit: 00
	Capabilities: [2c0 v1] #13
	Capabilities: [2d0 v1] #1b
	Kernel driver in use: radeon

00:01.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Kabini
HDMI/DP Audio
	Subsystem: Hewlett-Packard Company Device 22ea
	Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr-
Stepping- SERR- FastB2B- DisINTx+
	Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort-
<MAbort- >SERR- <PERR- INTx-
	Latency: 0, Cache Line Size: 64 bytes
	Interrupt: pin B routed to IRQ 36
	Region 0: Memory at fea64000 (64-bit, non-prefetchable) [size=16K]
	Capabilities: [48] Vendor Specific Information: Len=08 <?>
	Capabilities: [50] Power Management version 3
		Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA
PME(D0-,D1-,D2-,D3hot-,D3cold-)
		Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
	Capabilities: [58] Express (v2) Root Complex Integrated Endpoint, MSI
00
		DevCap:	MaxPayload 256 bytes, PhantFunc 0
			ExtTag+ RBE+
		DevCtl:	Report errors: Correctable- Non-Fatal- Fatal- Unsupported-
			RlxdOrd+ ExtTag- PhantFunc- AuxPwr- NoSnoop+
			MaxPayload 128 bytes, MaxReadReq 512 bytes
		DevSta:	CorrErr- UncorrErr- FatalErr- UnsuppReq- AuxPwr- TransPend-
		DevCap2: Completion Timeout: Not Supported, TimeoutDis-, LTR-, OBFF
Not Supported
		DevCtl2: Completion Timeout: 50us to 50ms, TimeoutDis-, LTR-, OBFF
Disabled
	Capabilities: [a0] MSI: Enable+ Count=1/1 Maskable- 64bit+
		Address: 00000000fee0f00c  Data: 41a2
	Capabilities: [100 v1] Vendor Specific Information: ID=0001 Rev=1
Len=010 <?>
	Kernel driver in use: snd_hda_intel

00:02.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Device 156b
	Control: I/O- Mem- BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr-
Stepping- SERR- FastB2B- DisINTx-
	Status: Cap- 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort-
<MAbort- >SERR- <PERR- INTx-

00:02.2 PCI bridge: Advanced Micro Devices, Inc. [AMD] Family 16h
Processor Functions 5:1 (prog-if 00 [Normal decode])
	Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr-
Stepping- SERR- FastB2B- DisINTx-
	Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort-
<MAbort- >SERR- <PERR- INTx-
	Latency: 0, Cache Line Size: 64 bytes
	Bus: primary=00, secondary=01, subordinate=01, sec-latency=0
	I/O behind bridge: 0000f000-00000fff
	Memory behind bridge: fe900000-fe9fffff
	Prefetchable memory behind bridge: 00000000fff00000-00000000000fffff
	Secondary status: 66MHz- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort-
<MAbort+ <SERR- <PERR-
	BridgeCtl: Parity- SERR- NoISA- VGA- MAbort- >Reset- FastB2B-
		PriDiscTmr- SecDiscTmr- DiscTmrStat- DiscTmrSERREn-
	Capabilities: [50] Power Management version 3
		Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0+,D1-,D2-,D3hot
+,D3cold+)
		Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
	Capabilities: [58] Express (v2) Root Port (Slot+), MSI 00
		DevCap:	MaxPayload 512 bytes, PhantFunc 0
			ExtTag+ RBE+
		DevCtl:	Report errors: Correctable- Non-Fatal- Fatal- Unsupported-
			RlxdOrd- ExtTag- PhantFunc- AuxPwr- NoSnoop+
			MaxPayload 128 bytes, MaxReadReq 512 bytes
		DevSta:	CorrErr- UncorrErr- FatalErr- UnsuppReq- AuxPwr- TransPend-
		LnkCap:	Port #1, Speed 2.5GT/s, Width x1, ASPM L0s L1, Exit Latency
L0s <512ns, L1 <64us
			ClockPM- Surprise- LLActRep+ BwNot+
		LnkCtl:	ASPM L1 Enabled; RCB 64 bytes Disabled- CommClk+
			ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
		LnkSta:	Speed 2.5GT/s, Width x1, TrErr- Train- SlotClk+ DLActive+
BWMgmt+ ABWMgmt-
		SltCap:	AttnBtn- PwrCtrl- MRL- AttnInd- PwrInd- HotPlug- Surprise-
			Slot #0, PowerLimit 0.000W; Interlock- NoCompl+
		SltCtl:	Enable: AttnBtn- PwrFlt- MRL- PresDet- CmdCplt- HPIrq-
LinkChg-
			Control: AttnInd Unknown, PwrInd Unknown, Power- Interlock-
		SltSta:	Status: AttnBtn- PowerFlt- MRL- CmdCplt- PresDet+ Interlock-
			Changed: MRL- PresDet- LinkState-
		RootCtl: ErrCorrectable- ErrNon-Fatal- ErrFatal- PMEIntEna- CRSVisible
+
		RootCap: CRSVisible-
		RootSta: PME ReqID 0000, PMEStatus- PMEPending-
		DevCap2: Completion Timeout: Range ABCD, TimeoutDis+, LTR-, OBFF Not
Supported ARIFwd-
		DevCtl2: Completion Timeout: 65ms to 210ms, TimeoutDis-, LTR-, OBFF
Disabled ARIFwd-
		LnkCtl2: Target Link Speed: 2.5GT/s, EnterCompliance- SpeedDis+
			 Transmit Margin: Normal Operating Range, EnterModifiedCompliance-
ComplianceSOS-
			 Compliance De-emphasis: -6dB
		LnkSta2: Current De-emphasis Level: -6dB, EqualizationComplete-,
EqualizationPhase1-
			 EqualizationPhase2-, EqualizationPhase3-, LinkEqualizationRequest-
	Capabilities: [a0] MSI: Enable- Count=1/1 Maskable- 64bit+
		Address: 0000000000000000  Data: 0000
	Capabilities: [b0] Subsystem: Hewlett-Packard Company Device 22ea
	Capabilities: [b8] HyperTransport: MSI Mapping Enable+ Fixed+
	Capabilities: [100 v1] Vendor Specific Information: ID=0001 Rev=1
Len=010 <?>
	Kernel driver in use: pcieport

00:08.0 Encryption controller: Advanced Micro Devices, Inc. [AMD] Device
1537
	Subsystem: Hewlett-Packard Company Device 22ea
	Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr-
Stepping- SERR- FastB2B- DisINTx+
	Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort-
<MAbort- >SERR- <PERR- INTx-
	Latency: 0
	Region 0: Memory at d0800000 (64-bit, prefetchable) [size=128K]
	Region 2: Memory at fe800000 (32-bit, non-prefetchable) [size=1M]
	Region 3: Memory at fea70000 (32-bit, non-prefetchable) [size=4K]
	Region 5: Memory at fea6a000 (32-bit, non-prefetchable) [size=8K]
	Capabilities: [50] MSI-X: Enable+ Count=2 Masked-
		Vector table: BAR=5 offset=00000000
		PBA: BAR=5 offset=00001000
	Capabilities: [5c] HyperTransport: MSI Mapping Enable+ Fixed+
	Capabilities: [60] Power Management version 3
		Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA
PME(D0-,D1-,D2-,D3hot-,D3cold-)
		Status: D0 NoSoftRst+ PME-Enable- DSel=0 DScale=0 PME-
	Kernel driver in use: AMD Cryptographic Coprocessor

00:10.0 USB controller: Advanced Micro Devices, Inc. [AMD] FCH USB XHCI
Controller (rev 11) (prog-if 30 [XHCI])
	Subsystem: Hewlett-Packard Company Device 22ea
	Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr-
Stepping- SERR- FastB2B- DisINTx+
	Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort-
<MAbort- >SERR- <PERR- INTx-
	Latency: 0, Cache Line Size: 64 bytes
	Interrupt: pin A routed to IRQ 18
	Region 0: Memory at fea68000 (64-bit, non-prefetchable) [size=8K]
	Capabilities: [50] Power Management version 3
		Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0+,D1-,D2-,D3hot
+,D3cold+)
		Status: D0 NoSoftRst+ PME-Enable- DSel=0 DScale=0 PME-
	Capabilities: [70] MSI: Enable- Count=1/8 Maskable- 64bit+
		Address: 0000000000000000  Data: 0000
	Capabilities: [90] MSI-X: Enable+ Count=8 Masked-
		Vector table: BAR=0 offset=00001000
		PBA: BAR=0 offset=00001080
	Capabilities: [a0] Express (v2) Root Complex Integrated Endpoint, MSI
00
		DevCap:	MaxPayload 128 bytes, PhantFunc 0
			ExtTag- RBE+
		DevCtl:	Report errors: Correctable- Non-Fatal- Fatal- Unsupported-
			RlxdOrd- ExtTag- PhantFunc- AuxPwr- NoSnoop+
			MaxPayload 128 bytes, MaxReadReq 512 bytes
		DevSta:	CorrErr- UncorrErr- FatalErr- UnsuppReq- AuxPwr+ TransPend-
		DevCap2: Completion Timeout: Not Supported, TimeoutDis+, LTR+, OBFF
Not Supported
		DevCtl2: Completion Timeout: 50us to 50ms, TimeoutDis-, LTR-, OBFF
Disabled
	Capabilities: [100 v1] Latency Tolerance Reporting
		Max snoop latency: 0ns
		Max no snoop latency: 0ns
	Kernel driver in use: xhci_hcd

00:11.0 SATA controller: Advanced Micro Devices, Inc. [AMD] FCH SATA
Controller [AHCI mode] (rev 40) (prog-if 01 [AHCI 1.0])
	Subsystem: Hewlett-Packard Company Device 22ea
	Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr-
Stepping- SERR- FastB2B- DisINTx+
	Status: Cap+ 66MHz+ UDF- FastB2B- ParErr- DEVSEL=medium >TAbort-
<TAbort- <MAbort- >SERR- <PERR- INTx-
	Latency: 32
	Interrupt: pin A routed to IRQ 30
	Region 0: I/O ports at f140 [size=8]
	Region 1: I/O ports at f130 [size=4]
	Region 2: I/O ports at f120 [size=8]
	Region 3: I/O ports at f110 [size=4]
	Region 4: I/O ports at f100 [size=16]
	Region 5: Memory at fea6f000 (32-bit, non-prefetchable) [size=1K]
	Capabilities: [60] Power Management version 3
		Flags: PMEClk- DSI+ D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot
+,D3cold-)
		Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
	Capabilities: [70] SATA HBA v1.0 InCfgSpace
	Capabilities: [50] MSI: Enable+ Count=1/8 Maskable- 64bit+
		Address: 00000000fee0f00c  Data: 4142
	Kernel driver in use: ahci

00:12.0 USB controller: Advanced Micro Devices, Inc. [AMD] FCH USB EHCI
Controller (rev 39) (prog-if 20 [EHCI])
	Subsystem: Hewlett-Packard Company Device 22ea
	Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV+ VGASnoop- ParErr-
Stepping- SERR- FastB2B- DisINTx-
	Status: Cap+ 66MHz+ UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort-
<TAbort- <MAbort- >SERR- <PERR- INTx-
	Latency: 32, Cache Line Size: 64 bytes
	Interrupt: pin A routed to IRQ 18
	Region 0: Memory at fea6e000 (32-bit, non-prefetchable) [size=256]
	Capabilities: [c0] Power Management version 2
		Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA PME(D0+,D1+,D2+,D3hot
+,D3cold+)
		Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
		Bridge: PM- B3+
	Capabilities: [e4] Debug port: BAR=1 offset=00e0
	Kernel driver in use: ehci-pci

00:13.0 USB controller: Advanced Micro Devices, Inc. [AMD] FCH USB EHCI
Controller (rev 39) (prog-if 20 [EHCI])
	Subsystem: Hewlett-Packard Company Device 22ea
	Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV+ VGASnoop- ParErr-
Stepping- SERR- FastB2B- DisINTx-
	Status: Cap+ 66MHz+ UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort-
<TAbort- <MAbort- >SERR- <PERR- INTx-
	Latency: 32, Cache Line Size: 64 bytes
	Interrupt: pin A routed to IRQ 18
	Region 0: Memory at fea6d000 (32-bit, non-prefetchable) [size=256]
	Capabilities: [c0] Power Management version 2
		Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA PME(D0+,D1+,D2+,D3hot
+,D3cold+)
		Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
		Bridge: PM- B3+
	Capabilities: [e4] Debug port: BAR=1 offset=00e0
	Kernel driver in use: ehci-pci

00:14.0 SMBus: Advanced Micro Devices, Inc. [AMD] FCH SMBus Controller
(rev 42)
	Subsystem: Hewlett-Packard Company Device 22ea
	Control: I/O+ Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr-
Stepping- SERR- FastB2B- DisINTx+
	Status: Cap- 66MHz+ UDF- FastB2B- ParErr- DEVSEL=medium >TAbort-
<TAbort- <MAbort- >SERR- <PERR- INTx-
	Kernel driver in use: piix4_smbus

00:14.2 Audio device: Advanced Micro Devices, Inc. [AMD] FCH Azalia
Controller (rev 02)
	Subsystem: Hewlett-Packard Company Device 22ea
	Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr-
Stepping- SERR- FastB2B- DisINTx-
	Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=slow >TAbort- <TAbort-
<MAbort- >SERR- <PERR- INTx-
	Latency: 32, Cache Line Size: 64 bytes
	Interrupt: pin A routed to IRQ 16
	Region 0: Memory at fea60000 (64-bit, non-prefetchable) [size=16K]
	Capabilities: [50] Power Management version 2
		Flags: PMEClk- DSI- D1- D2- AuxCurrent=55mA PME(D0+,D1-,D2-,D3hot
+,D3cold+)
		Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
	Kernel driver in use: snd_hda_intel

00:14.3 ISA bridge: Advanced Micro Devices, Inc. [AMD] FCH LPC Bridge
(rev 11)
	Subsystem: Hewlett-Packard Company Device 22ea
	Control: I/O+ Mem+ BusMaster+ SpecCycle+ MemWINV- VGASnoop- ParErr-
Stepping- SERR- FastB2B- DisINTx-
	Status: Cap- 66MHz+ UDF- FastB2B- ParErr- DEVSEL=medium >TAbort-
<TAbort- <MAbort- >SERR- <PERR- INTx-
	Latency: 0

00:14.7 SD Host controller: Advanced Micro Devices, Inc. [AMD] FCH SD
Flash Controller (rev 01) (prog-if 01)
	Subsystem: Hewlett-Packard Company Device 22ea
	Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr-
Stepping- SERR- FastB2B- DisINTx-
	Status: Cap+ 66MHz+ UDF- FastB2B- ParErr- DEVSEL=medium >TAbort-
<TAbort- <MAbort- >SERR- <PERR- INTx-
	Latency: 39, Cache Line Size: 64 bytes
	Interrupt: pin A routed to IRQ 16
	Region 0: Memory at fea6c000 (64-bit, non-prefetchable) [size=256]
	Capabilities: [80] MSI: Enable- Count=1/1 Maskable- 64bit+
		Address: 0000000000000000  Data: 0000
	Capabilities: [90] Power Management version 3
		Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA
PME(D0-,D1-,D2-,D3hot-,D3cold+)
		Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
	Kernel driver in use: sdhci-pci

00:18.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Device 1580
	Control: I/O- Mem- BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr-
Stepping- SERR- FastB2B- DisINTx-
	Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort-
<MAbort- >SERR- <PERR- INTx-

00:18.1 Host bridge: Advanced Micro Devices, Inc. [AMD] Device 1581
	Control: I/O- Mem- BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr-
Stepping- SERR- FastB2B- DisINTx-
	Status: Cap- 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort-
<MAbort- >SERR- <PERR- INTx-

00:18.2 Host bridge: Advanced Micro Devices, Inc. [AMD] Device 1582
	Control: I/O- Mem- BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr-
Stepping- SERR- FastB2B- DisINTx-
	Status: Cap- 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort-
<MAbort- >SERR- <PERR- INTx-

00:18.3 Host bridge: Advanced Micro Devices, Inc. [AMD] Device 1583
	Control: I/O- Mem- BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr-
Stepping- SERR- FastB2B- DisINTx-
	Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort-
<MAbort- >SERR- <PERR- INTx-
	Capabilities: [f0] Secure device <?>
	Kernel driver in use: fam15h_power

00:18.4 Host bridge: Advanced Micro Devices, Inc. [AMD] Device 1584
	Control: I/O- Mem- BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr-
Stepping- SERR- FastB2B- DisINTx-
	Status: Cap- 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort-
<MAbort- >SERR- <PERR- INTx-

00:18.5 Host bridge: Advanced Micro Devices, Inc. [AMD] Device 1585
	Control: I/O- Mem- BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr-
Stepping- SERR- FastB2B- DisINTx-
	Status: Cap- 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort-
<MAbort- >SERR- <PERR- INTx-

01:00.0 Network controller: Broadcom Corporation BCM43142 802.11b/g/n
(rev 01)
	Subsystem: Hewlett-Packard Company Device 2232
	Control: I/O- Mem- BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr-
Stepping- SERR- FastB2B- DisINTx-
	Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort-
<MAbort- >SERR- <PERR- INTx-
	Interrupt: pin A routed to IRQ 255
	Region 0: Memory at fe900000 (64-bit, non-prefetchable) [disabled]
[size=32K]
	Capabilities: [40] Power Management version 3
		Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA PME(D0+,D1-,D2-,D3hot
+,D3cold+)
		Status: D0 NoSoftRst+ PME-Enable- DSel=0 DScale=2 PME-
	Capabilities: [58] Vendor Specific Information: Len=78 <?>
	Capabilities: [48] MSI: Enable- Count=1/1 Maskable- 64bit+
		Address: 0000000000000000  Data: 0000
	Capabilities: [d0] Express (v1) Endpoint, MSI 00
		DevCap:	MaxPayload 128 bytes, PhantFunc 0, Latency L0s <4us, L1
unlimited
			ExtTag+ AttnBtn- AttnInd- PwrInd- RBE+ FLReset-
		DevCtl:	Report errors: Correctable- Non-Fatal- Fatal- Unsupported-
			RlxdOrd- ExtTag- PhantFunc- AuxPwr- NoSnoop-
			MaxPayload 128 bytes, MaxReadReq 512 bytes
		DevSta:	CorrErr+ UncorrErr- FatalErr- UnsuppReq+ AuxPwr+ TransPend-
		LnkCap:	Port #0, Speed 2.5GT/s, Width x1, ASPM L0s L1, Exit Latency
L0s <4us, L1 <64us
			ClockPM+ Surprise- LLActRep- BwNot-
		LnkCtl:	ASPM L1 Enabled; RCB 64 bytes Disabled- CommClk+
			ExtSynch- ClockPM+ AutWidDis- BWInt- AutBWInt-
		LnkSta:	Speed 2.5GT/s, Width x1, TrErr- Train- SlotClk+ DLActive-
BWMgmt- ABWMgmt-
	Capabilities: [100 v1] Advanced Error Reporting
		UESta:	DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF-
MalfTLP- ECRC- UnsupReq- ACSViol-
		UEMsk:	DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF-
MalfTLP- ECRC- UnsupReq- ACSViol-
		UESvrt:	DLP+ SDES+ TLP- FCP+ CmpltTO- CmpltAbrt- UnxCmplt- RxOF+
MalfTLP+ ECRC- UnsupReq- ACSViol-
		CESta:	RxErr- BadTLP- BadDLLP- Rollover- Timeout- NonFatalErr+
		CEMsk:	RxErr- BadTLP- BadDLLP- Rollover- Timeout- NonFatalErr+
		AERCap:	First Error Pointer: 14, GenCap+ CGenEn- ChkCap+ ChkEn-
	Capabilities: [13c v1] Virtual Channel
		Caps:	LPEVC=0 RefClk=100ns PATEntryBits=1
		Arb:	Fixed- WRR32- WRR64- WRR128-
		Ctrl:	ArbSelect=Fixed
		Status:	InProgress-
		VC0:	Caps:	PATOffset=00 MaxTimeSlots=1 RejSnoopTrans-
			Arb:	Fixed- WRR32- WRR64- WRR128- TWRR128- WRR256-
			Ctrl:	Enable+ ID=0 ArbSelect=Fixed TC/VC=01
			Status:	NegoPending- InProgress-
	Capabilities: [160 v1] Device Serial Number 00-00-41-ff-ff-f1-b0-10
	Capabilities: [16c v1] Power Budgeting <?>


[7.6.] SCSI information (from /proc/scsi/scsi)
Attached devices:
Host: scsi0 Channel: 00 Id: 00 Lun: 00
  Vendor: ATA      Model: BHT WR202A1064G  Rev: 00  
  Type:   Direct-Access                    ANSI  SCSI revision: 05

[7.7.] Other information that might be relevant to the problem (please
look in /proc and include all information that you think to be
relevant):
1
10
11
12
1200
1205
1206
1212
1213
1218
1226
1265
1291
13
1365
139
14
140
141
1412
142
1437
144
1459
146
147
148
1494
1497
15
151
153
1532
1557
16
1641
1677
17
18
1828
1866
1877
19
1954
1964
198
1988
1989
199
1999
2
20
2011
2027
2040
2043
2045
2046
2051
2060
2062
2070
2086
21
2115
2144
2170
2178
22
2257
2263
2271
2281
2287
2297
23
2300
2309
2315
2319
2323
2328
2329
2332
2335
2363
2364
2370
2376
24
2404
2457
247
2478
2494
25
2501
2507
2516
2526
2533
2534
2586
26
2689
27
2701
2711
2736
2791
2798
2799
28
2801
2805
2808
29
3
3017
3052
31
310
32
33
3305
3323
34
343
35
352
36
37
38
39
40
41
42
43
44
45
46
461
463
464
465
47
48
494
5
50
51
527
53
530
55
56
567
568
57
571
589
6
600
637
642
653
654
667
673
69
7
70
71
72
73
8
817
850
871
9
907
92
926
93
934
937
940
945
968
acpi
asound
buddyinfo
bus
cgroups
cmdline
consoles
cpuinfo
crypto
devices
diskstats
dma
driver
execdomains
fb
filesystems
fs
interrupts
iomem
ioports
irq
kallsyms
kcore
keys
key-users
kmsg
kpagecount
kpageflags
loadavg
locks
mdstat
meminfo
misc
modules
mounts
mtrr
net
pagetypeinfo
partitions
sched_debug
schedstat
scsi
self
slabinfo
softirqs
stat
swaps
sys
sysrq-trigger
sysvipc
thread-self
timer_list
timer_stats
tty
uptime
version
vmallocinfo
vmstat
zoneinfo

[X.] Other notes, patches, fixes, workarounds:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1390915

sudo tpconfig
Found Synaptics Touchpad.
Firmware: 8.96 (multiple-byte mode).

xinput --list:
⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ PS/2 Generic Mouse id=11 [slave pointer (2)]
⎣ Virtual core keyboard id=3 [master keyboard (2)]
    ↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)]
    ↳ Power Button id=6 [slave keyboard (3)]
    ↳ Video Bus id=7 [slave keyboard (3)]
    ↳ Power Button id=8 [slave keyboard (3)]
    ↳ HP Truevision HD id=9 [slave keyboard (3)]
    ↳ AT Translated Set 2 keyboard id=10 [slave keyboard (3)]
    ↳ HP WMI hotkeys id=12 [slave keyboard (3)]
    ↳ HP Wireless hotkeys id=13 [slave keyboard (3)]

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply

* Fwd: [Bug 87991] New: hid-sony uses non-DMA-capable transfer buffer, fails
From: Dmitry Torokhov @ 2014-11-10 18:37 UTC (permalink / raw)
  To: Frank Praznik; +Cc: Jiri Kosina, linux-input@vger.kernel.org
In-Reply-To: <bug-87991-3268@https.bugzilla.kernel.org/>

FYI

---------- Forwarded message ----------
From:  <bugzilla-daemon@bugzilla.kernel.org>
Date: Mon, Nov 10, 2014 at 5:43 AM
Subject: [Bug 87991] New: hid-sony uses non-DMA-capable transfer buffer, fails
To: dmitry.torokhov@gmail.com


https://bugzilla.kernel.org/show_bug.cgi?id=87991

            Bug ID: 87991
           Summary: hid-sony uses non-DMA-capable transfer buffer, fails
           Product: Drivers
           Version: 2.5
    Kernel Version: 3.17.1
          Hardware: All
                OS: Linux
              Tree: Mainline
            Status: NEW
          Severity: normal
          Priority: P1
         Component: Input Devices
          Assignee: drivers_input-devices@kernel-bugs.osdl.org
          Reporter: hector@marcansoft.com
        Regression: No

The kernel itself complains:

input: Sony PLAYSTATION(R)3 Controller as
/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2.2/1-1.2.2.4/1-1.2.2.4:1.0/0003:054C:0268.000A/input/input51
sony 0003:054C:0268.000A: input,hiddev0,hidraw3: USB HID v1.11 Joystick [Sony
PLAYSTATION(R)3 Controller] on usb-0000:00:1a.0-1.2.2.4/input0
------------[ cut here ]------------
WARNING: CPU: 1 PID: 27497 at drivers/usb/core/hcd.c:1503
usb_hcd_map_urb_for_dma+0x588/0x5a0 [usbcore]()
transfer buffer not dma capable
<snip>
sony 0003:054C:0268.000A: failed to retrieve feature report 0xf2 with the
Sixaxis MAC address
sony: probe of 0003:054C:0268.000A failed with error -11

Looks like the code just uses a stack-allocated buffer (from
drivers/hid/hid-sony.c):
        __u8 buf[18];
<snip comment>
        ret = hid_hw_raw_request(sc->hdev, 0xf2, buf, sizeof(buf),
                HID_FEATURE_REPORT, HID_REQ_GET_REPORT);

--
You are receiving this mail because:
You are watching the assignee of the bug.


-- 
Dmitry

^ permalink raw reply

* Re: [PATCH 1/1] Input: xpad - update docs to reflect current state
From: Thomaz de Oliveira dos Reis @ 2014-11-10 12:27 UTC (permalink / raw)
  To: Daniel Dressler
  Cc: Jonathan Corbet, Dmitry Torokhov, Tommi Rantala, Ted Mielczarek,
	Paul Gortmaker, Frank Razenberg, Benjamin Valentin, Petr Sebor,
	open list:DOCUMENTATION, open list, linux-input
In-Reply-To: <CAGC3nLCaX06n5Nw5ND-wg0_dtD-fD8Pn+CjP-BW8OJK5hz58Kg@mail.gmail.com>

Ok, I got your point... So having both looks like the best option to me.

2014-11-10 10:15 GMT-02:00 Daniel Dressler <danieru.dressler@gmail.com>:
> I'd love to make all controllers report as axises but doing so _will_
> break stuff downstream. Not least of which being every game which uses
> SDL2's controller configs:
> https://github.com/gabomdq/SDL_GameControllerDB/blob/master/gamecontrollerdb.txt
>
> Which is just about every-single major commercial proprietary game
> which has been ported to linux in the past 2 years.
>
> Now it should also be clear that adding extra axises will not break
> those games. The SDL2 library should just ignore those axises.
>
> Also, the module option "dpad_to_buttons" will only operate on unknown
> devices. Users cannot use it to return to old behavior so we have to
> get this right.
>
> Daniel
>
> 2014-11-10 20:47 GMT+09:00 Thomaz de Oliveira dos Reis <thor27@gmail.com>:
>> I totally agree that the behavior should be exactly the same in all
>> XBOX gamepads. But In my opinion this should be mapped as axis only,
>> since mapping for both could make a confusion in some games.
>>
>> If you need the axis to be buttons, you can set as a option while
>> loading the module.
>>
>>
>>
>>
>> 2014-11-10 6:06 GMT-02:00 Daniel Dressler <danieru.dressler@gmail.com>:
>>> Thanks Jon
>>>
>>> I've sent a second version of the patch without the TODO list edits.
>>>
>>>
>>> Now I would like to ask about a backwards compact issue related to this driver.
>>>
>>> Eons ago in patch 99de0912b [0] when support for the wireless 360
>>> controllers were added the decision was made to map their Dpad to the
>>> discrete buttons.
>>>
>>> There is reasonable justification for this behavior since the Dpad has
>>> never functioned like an analog stick on Xbox hardware.
>>>
>>> Except support for wired 360 controllers had been added a year earlier
>>> and used the opposite behavior. In fact the wireless 360 controllers
>>> are the only controllers which use the dpad_to_button behavior.
>>>
>>> Original Xbox, wired Xbox 360, and all Xbox One controllers all expose
>>> the dpad as a set of axises.
>>>
>>> This has caused pain for downstream developers. It means two
>>> controllers  have wildly different behavior. Many developers have just
>>> ignored the issue or suggested users unload xpand and use the userland
>>> replacement. Even Arch's wiki suggests such [1]. Which to be honest is
>>> all one can do. The xpad driver does not expose the information
>>> developers need to even incorporate a workaround without nasty hacks.
>>>
>>> As a downstream developer I've been bitten by this twice. The first
>>> time I didn't even know that wired vs wireless made a difference and I
>>> was disturbed to learn the truth.
>>>
>>> So here is what I want to hear opinions on: should the wireless 360's
>>> dpad be exposed as both axises _and_ buttons?
>>>
>>> [0]: https://github.com/torvalds/linux/commit/99de0912b when t
>>> [1]: https://wiki.archlinux.org/index.php/joystick#Xbox_360_controllers
>>>
>>> Daniel
>>>
>>> 2014-11-08 3:48 GMT+09:00 Jonathan Corbet <corbet@lwn.net>:
>>>> On Mon,  3 Nov 2014 17:53:06 +0900
>>>> Daniel Dressler <danieru.dressler@gmail.com> wrote:
>>>>
>>>>> The last time this documentation was accurate was
>>>>> just over 8 years ago. In this time we've added
>>>>> support for two new generations of Xbox console
>>>>> controllers and dozens of third-party controllers.
>>>>>
>>>>> This patch unifies terminology and makes it explicit
>>>>> which model of controller a sentence refers to.
>>>>
>>>> So this seems like a useful update, and I was looking at pulling it into
>>>> the docs tree.  But this hunk:
>>>>
>>>>> diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
>>>>> index 2ed7905..7e2e047 100644
>>>>> --- a/drivers/input/joystick/xpad.c
>>>>> +++ b/drivers/input/joystick/xpad.c
>>>>> @@ -40,8 +40,8 @@
>>>>>   *
>>>>>   * TODO:
>>>>>   *  - fine tune axes (especially trigger axes)
>>>>> - *  - fix "analog" buttons (reported as digital now)
>>>>> - *  - get rumble working
>>>>> + *  - add original xbox rumble pack support
>>>>> + *  - add xbox one rumble support
>>>>>   *  - need USB IDs for other dance pads
>>>>>   *
>>>>>   * History:
>>>>
>>>> Seems like a different change that shouldn't be mixed up with the doc
>>>> update.  Send me a version without that change and, in the absence
>>>> of complaints, I'll apply it.
>>>>
>>>> Thanks,
>>>>
>>>> jon

^ permalink raw reply

* Re: [PATCH 1/1] Input: xpad - update docs to reflect current state
From: Daniel Dressler @ 2014-11-10 12:15 UTC (permalink / raw)
  To: Thomaz de Oliveira dos Reis
  Cc: Jonathan Corbet, Dmitry Torokhov, Tommi Rantala, Ted Mielczarek,
	Paul Gortmaker, Frank Razenberg, Benjamin Valentin, Petr Sebor,
	open list:DOCUMENTATION, open list, linux-input
In-Reply-To: <CAAXmX-kid7K8kWGnhe-AahrqHPiwpnggfQbVBD+A3cVK6rmAuQ@mail.gmail.com>

I'd love to make all controllers report as axises but doing so _will_
break stuff downstream. Not least of which being every game which uses
SDL2's controller configs:
https://github.com/gabomdq/SDL_GameControllerDB/blob/master/gamecontrollerdb.txt

Which is just about every-single major commercial proprietary game
which has been ported to linux in the past 2 years.

Now it should also be clear that adding extra axises will not break
those games. The SDL2 library should just ignore those axises.

Also, the module option "dpad_to_buttons" will only operate on unknown
devices. Users cannot use it to return to old behavior so we have to
get this right.

Daniel

2014-11-10 20:47 GMT+09:00 Thomaz de Oliveira dos Reis <thor27@gmail.com>:
> I totally agree that the behavior should be exactly the same in all
> XBOX gamepads. But In my opinion this should be mapped as axis only,
> since mapping for both could make a confusion in some games.
>
> If you need the axis to be buttons, you can set as a option while
> loading the module.
>
>
>
>
> 2014-11-10 6:06 GMT-02:00 Daniel Dressler <danieru.dressler@gmail.com>:
>> Thanks Jon
>>
>> I've sent a second version of the patch without the TODO list edits.
>>
>>
>> Now I would like to ask about a backwards compact issue related to this driver.
>>
>> Eons ago in patch 99de0912b [0] when support for the wireless 360
>> controllers were added the decision was made to map their Dpad to the
>> discrete buttons.
>>
>> There is reasonable justification for this behavior since the Dpad has
>> never functioned like an analog stick on Xbox hardware.
>>
>> Except support for wired 360 controllers had been added a year earlier
>> and used the opposite behavior. In fact the wireless 360 controllers
>> are the only controllers which use the dpad_to_button behavior.
>>
>> Original Xbox, wired Xbox 360, and all Xbox One controllers all expose
>> the dpad as a set of axises.
>>
>> This has caused pain for downstream developers. It means two
>> controllers  have wildly different behavior. Many developers have just
>> ignored the issue or suggested users unload xpand and use the userland
>> replacement. Even Arch's wiki suggests such [1]. Which to be honest is
>> all one can do. The xpad driver does not expose the information
>> developers need to even incorporate a workaround without nasty hacks.
>>
>> As a downstream developer I've been bitten by this twice. The first
>> time I didn't even know that wired vs wireless made a difference and I
>> was disturbed to learn the truth.
>>
>> So here is what I want to hear opinions on: should the wireless 360's
>> dpad be exposed as both axises _and_ buttons?
>>
>> [0]: https://github.com/torvalds/linux/commit/99de0912b when t
>> [1]: https://wiki.archlinux.org/index.php/joystick#Xbox_360_controllers
>>
>> Daniel
>>
>> 2014-11-08 3:48 GMT+09:00 Jonathan Corbet <corbet@lwn.net>:
>>> On Mon,  3 Nov 2014 17:53:06 +0900
>>> Daniel Dressler <danieru.dressler@gmail.com> wrote:
>>>
>>>> The last time this documentation was accurate was
>>>> just over 8 years ago. In this time we've added
>>>> support for two new generations of Xbox console
>>>> controllers and dozens of third-party controllers.
>>>>
>>>> This patch unifies terminology and makes it explicit
>>>> which model of controller a sentence refers to.
>>>
>>> So this seems like a useful update, and I was looking at pulling it into
>>> the docs tree.  But this hunk:
>>>
>>>> diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
>>>> index 2ed7905..7e2e047 100644
>>>> --- a/drivers/input/joystick/xpad.c
>>>> +++ b/drivers/input/joystick/xpad.c
>>>> @@ -40,8 +40,8 @@
>>>>   *
>>>>   * TODO:
>>>>   *  - fine tune axes (especially trigger axes)
>>>> - *  - fix "analog" buttons (reported as digital now)
>>>> - *  - get rumble working
>>>> + *  - add original xbox rumble pack support
>>>> + *  - add xbox one rumble support
>>>>   *  - need USB IDs for other dance pads
>>>>   *
>>>>   * History:
>>>
>>> Seems like a different change that shouldn't be mixed up with the doc
>>> update.  Send me a version without that change and, in the absence
>>> of complaints, I'll apply it.
>>>
>>> Thanks,
>>>
>>> jon

^ permalink raw reply

* Re: [PATCH 1/1] Input: xpad - update docs to reflect current state
From: Thomaz de Oliveira dos Reis @ 2014-11-10 11:47 UTC (permalink / raw)
  To: Daniel Dressler
  Cc: Jonathan Corbet, Dmitry Torokhov, Tommi Rantala, Ted Mielczarek,
	Paul Gortmaker, Frank Razenberg, Benjamin Valentin, Petr Sebor,
	open list:DOCUMENTATION, open list, linux-input
In-Reply-To: <CAGC3nLBsX9fEjjmX2OGKnyTxuxbV_FNfndsoPbjob4UQqpuPpg@mail.gmail.com>

I totally agree that the behavior should be exactly the same in all
XBOX gamepads. But In my opinion this should be mapped as axis only,
since mapping for both could make a confusion in some games.

If you need the axis to be buttons, you can set as a option while
loading the module.




2014-11-10 6:06 GMT-02:00 Daniel Dressler <danieru.dressler@gmail.com>:
> Thanks Jon
>
> I've sent a second version of the patch without the TODO list edits.
>
>
> Now I would like to ask about a backwards compact issue related to this driver.
>
> Eons ago in patch 99de0912b [0] when support for the wireless 360
> controllers were added the decision was made to map their Dpad to the
> discrete buttons.
>
> There is reasonable justification for this behavior since the Dpad has
> never functioned like an analog stick on Xbox hardware.
>
> Except support for wired 360 controllers had been added a year earlier
> and used the opposite behavior. In fact the wireless 360 controllers
> are the only controllers which use the dpad_to_button behavior.
>
> Original Xbox, wired Xbox 360, and all Xbox One controllers all expose
> the dpad as a set of axises.
>
> This has caused pain for downstream developers. It means two
> controllers  have wildly different behavior. Many developers have just
> ignored the issue or suggested users unload xpand and use the userland
> replacement. Even Arch's wiki suggests such [1]. Which to be honest is
> all one can do. The xpad driver does not expose the information
> developers need to even incorporate a workaround without nasty hacks.
>
> As a downstream developer I've been bitten by this twice. The first
> time I didn't even know that wired vs wireless made a difference and I
> was disturbed to learn the truth.
>
> So here is what I want to hear opinions on: should the wireless 360's
> dpad be exposed as both axises _and_ buttons?
>
> [0]: https://github.com/torvalds/linux/commit/99de0912b when t
> [1]: https://wiki.archlinux.org/index.php/joystick#Xbox_360_controllers
>
> Daniel
>
> 2014-11-08 3:48 GMT+09:00 Jonathan Corbet <corbet@lwn.net>:
>> On Mon,  3 Nov 2014 17:53:06 +0900
>> Daniel Dressler <danieru.dressler@gmail.com> wrote:
>>
>>> The last time this documentation was accurate was
>>> just over 8 years ago. In this time we've added
>>> support for two new generations of Xbox console
>>> controllers and dozens of third-party controllers.
>>>
>>> This patch unifies terminology and makes it explicit
>>> which model of controller a sentence refers to.
>>
>> So this seems like a useful update, and I was looking at pulling it into
>> the docs tree.  But this hunk:
>>
>>> diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
>>> index 2ed7905..7e2e047 100644
>>> --- a/drivers/input/joystick/xpad.c
>>> +++ b/drivers/input/joystick/xpad.c
>>> @@ -40,8 +40,8 @@
>>>   *
>>>   * TODO:
>>>   *  - fine tune axes (especially trigger axes)
>>> - *  - fix "analog" buttons (reported as digital now)
>>> - *  - get rumble working
>>> + *  - add original xbox rumble pack support
>>> + *  - add xbox one rumble support
>>>   *  - need USB IDs for other dance pads
>>>   *
>>>   * History:
>>
>> Seems like a different change that shouldn't be mixed up with the doc
>> update.  Send me a version without that change and, in the absence
>> of complaints, I'll apply it.
>>
>> Thanks,
>>
>> jon

^ permalink raw reply

* RE: [PATCH v9 15/18] input: cyapa: add gen3 trackpad device read firmware image function support
From: Dudley Du @ 2014-11-10 11:05 UTC (permalink / raw)
  To: Dmitry Torokhov, Dudley Du
  Cc: rydberg@euromail.se, bleung@google.com,
	linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
In-Reply-To: <20141110083955.GD39688@dtor-ws>

Thanks, Dmitry

> -----Original Message-----
> From: Dmitry Torokhov [mailto:dmitry.torokhov@gmail.com]
> Sent: 2014?11?10? 16:40
> To: Dudley Du
> Cc: rydberg@euromail.se; Dudley Du; bleung@google.com;
> linux-input@vger.kernel.org; linux-kernel@vger.kernel.org
> Subject: Re: [PATCH v9 15/18] input: cyapa: add gen3 trackpad device read
> firmware image function support
>
> On Mon, Nov 03, 2014 at 04:33:07PM +0800, Dudley Du wrote:
> > Add read firmware image function supported for gen3 trackpad device,
> > it can be used through debugfs read_fw interface.
>
> Why do we need this? Can we do the same via usespace program accessing
> the i2c device through /dev/i2c-N?

This interface is used to test and debug only. It's defined and required by the chromium projects.

And in the driver side, becase the firmware image read process is done based on interrupt signal,
if do this in userspace through /dev/i2c-N, there will be two issues:
1) for gen5, after each command, an interrupt will be asserted, so if throug /dev/i2c-N,
userspace program cannot get the interrupt signal.
2) and when the interrupt signal assert, driver won't know it’s a command signal for image read,
so it will try to process it as data report.
To avoid this, additional interface must be added to mark the image read status and
block interrupt signal to be process as data report.

>
> Thanks.
>
> --
> Dmitry

This message and any attachments may contain Cypress (or its subsidiaries) confidential information. If it has been received in error, please advise the sender and immediately delete this message.

^ permalink raw reply

* RE: [PATCH v9 05/18] input: cyapa: add power management interfaces supported for the device
From: Dudley Du @ 2014-11-10 11:05 UTC (permalink / raw)
  To: Dmitry Torokhov, Dudley Du
  Cc: rydberg@euromail.se, bleung@google.com,
	linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
In-Reply-To: <20141110083806.GC39688@dtor-ws>

Thanks, Dmity

> -----Original Message-----
> From: Dmitry Torokhov [mailto:dmitry.torokhov@gmail.com]
> Sent: 2014?11?10? 16:38
> To: Dudley Du
> Cc: rydberg@euromail.se; Dudley Du; bleung@google.com;
> linux-input@vger.kernel.org; linux-kernel@vger.kernel.org
> Subject: Re: [PATCH v9 05/18] input: cyapa: add power management interfaces
> supported for the device
>
> On Mon, Nov 03, 2014 at 04:32:57PM +0800, Dudley Du wrote:
> > Add suspend_scanrate_ms power management interfaces in device's
> > power group, so users or applications can control the power management
> > strategy of trackpad device as their requirements.
> > TEST=test on Chromebooks.
> >
> > Signed-off-by: Dudley Du <dudl@cypress.com>
> > ---
> >  drivers/input/mouse/cyapa.c | 112
> ++++++++++++++++++++++++++++++++++++++++++++
> >  1 file changed, 112 insertions(+)
> >
> > diff --git a/drivers/input/mouse/cyapa.c b/drivers/input/mouse/cyapa.c
> > index fac361a..420696d 100644
> > --- a/drivers/input/mouse/cyapa.c
> > +++ b/drivers/input/mouse/cyapa.c
> > @@ -505,6 +505,96 @@ u16 cyapa_pwr_cmd_to_sleep_time(u8 pwr_mode)
> >     : (encoded_time - 5) * 20;
> >  }
> >
> > +#ifdef CONFIG_PM_SLEEP
> > +static ssize_t cyapa_show_suspend_scanrate(struct device *dev,
> > +   struct device_attribute *attr,
> > +   char *buf)
> > +{
> > +struct cyapa *cyapa = dev_get_drvdata(dev);
> > +u8 pwr_cmd = cyapa->suspend_power_mode;
> > +u16 sleep_time;
> > +int len;
> > +int ret;
> > +
> > +ret = mutex_lock_interruptible(&cyapa->state_sync_lock);
> > +if (ret)
> > +return ret;
> > +pwr_cmd = cyapa->suspend_power_mode;
> > +sleep_time = cyapa->suspend_sleep_time;
> > +mutex_unlock(&cyapa->state_sync_lock);
> > +
> > +if (pwr_cmd == PWR_MODE_BTN_ONLY)
> > +len = scnprintf(buf, PAGE_SIZE, "%s\n", BTN_ONLY_MODE_NAME);
> > +else if (pwr_cmd == PWR_MODE_OFF)
> > +len = scnprintf(buf, PAGE_SIZE, "%s\n", OFF_MODE_NAME);
> > +else {
> > +if (cyapa->gen == CYAPA_GEN3)
> > +sleep_time = cyapa_pwr_cmd_to_sleep_time(pwr_cmd);
> > +len = scnprintf(buf, PAGE_SIZE, "%u\n", sleep_time);
> > +}
> > +
> > +return len;
> > +}
> > +
> > +static u16 cyapa_clamp_sleep_time(u16 sleep_time)
> > +{
> > +if (sleep_time > 1000)
> > +sleep_time = 1000;
> > +return sleep_time;
> > +}
> > +
> > +static ssize_t cyapa_update_suspend_scanrate(struct device *dev,
> > +     struct device_attribute *attr,
> > +     const char *buf, size_t count)
> > +{
> > +struct cyapa *cyapa = dev_get_drvdata(dev);
> > +u16 sleep_time;
> > +int ret;
> > +
> > +ret = mutex_lock_interruptible(&cyapa->state_sync_lock);
> > +if (ret)
> > +return ret;
> > +
> > +if (sysfs_streq(buf, BTN_ONLY_MODE_NAME))
> > +cyapa->suspend_power_mode = PWR_MODE_BTN_ONLY;
> > +else if (sysfs_streq(buf, OFF_MODE_NAME))
> > +cyapa->suspend_power_mode = PWR_MODE_OFF;
> > +else if (!kstrtou16(buf, 10, &sleep_time)) {
> > +cyapa->suspend_sleep_time = cyapa_clamp_sleep_time(sleep_time);
>
> I'd simply do
>
> cyapa->suspend_sleep_time = max_t(u16, sleep_time, 1000);
>
> here.

Thanks, applied.

>
> > +cyapa->suspend_power_mode =
> > +cyapa_sleep_time_to_pwr_cmd(cyapa->suspend_sleep_time);
> > +} else
> > +count = 0;
> > +
>
> If one branch uses curly braces then all branches shoudl use them, even
> if they contain only one statement.

Thanks, I will go through all code to follow this rule.

>
> > +mutex_unlock(&cyapa->state_sync_lock);
> > +if (!count)
> > +dev_err(dev, "invalid suspend scanrate ms parameters\n");
> > +return count ? count : -EINVAL;
> > +}
> > +
> > +static DEVICE_ATTR(suspend_scanrate_ms, S_IRUGO|S_IWUSR,
> > +   cyapa_show_suspend_scanrate,
> > +   cyapa_update_suspend_scanrate);
> > +
> > +static struct attribute *cyapa_power_wakeup_entries[] = {
> > +&dev_attr_suspend_scanrate_ms.attr,
> > +NULL,
> > +};
> > +
> > +static const struct attribute_group cyapa_power_wakeup_group = {
> > +.name = power_group_name,
> > +.attrs = cyapa_power_wakeup_entries,
> > +};
> > +
> > +static void cyapa_remove_power_wakeup_group(void *data)
> > +{
> > +struct cyapa *cyapa = data;
> > +
> > +sysfs_unmerge_group(&cyapa->client->dev.kobj,
> > +&cyapa_power_wakeup_group);
> > +}
> > +#endif /* CONFIG_PM_SLEEP */
> > +
> >  /*
> >   * Returns:
> >   *   0    Driver and device initialization successfully done.
> > @@ -588,6 +678,28 @@ static int cyapa_probe(struct i2c_client *client,
> >  return ret;
> >  }
> >
> > +#ifdef CONFIG_PM_SLEEP
> > +if (device_can_wakeup(dev)) {
> > +ret = sysfs_merge_group(&client->dev.kobj,
> > +&cyapa_power_wakeup_group);
> > +if (ret) {
> > +dev_err(dev, "failed to add power wakeup group, (%d)\n",
> > +ret);
> > +return ret;
> > +}
> > +
> > +ret = devm_add_action(dev,
> > +cyapa_remove_power_wakeup_group, cyapa);
> > +if (ret) {
> > +cyapa_remove_power_wakeup_group(cyapa);
> > +dev_err(dev,
> > +"failed to add power cleanup action, (%d)\n",
> > +ret);
> > +return ret;
> > +}
> > +}
> > +#endif /* CONFIG_PM_SLEEP */
> > +
> >  return 0;
> >  }
> >
> > --
> > 1.9.1
> >
>
> --
> Dmitry

This message and any attachments may contain Cypress (or its subsidiaries) confidential information. If it has been received in error, please advise the sender and immediately delete this message.

^ permalink raw reply

* RE: [PATCH v9 03/18] input: cyapa: add gen3 trackpad device basic functions support
From: Dudley Du @ 2014-11-10 11:05 UTC (permalink / raw)
  To: Dmitry Torokhov, Dudley Du
  Cc: rydberg@euromail.se, bleung@google.com,
	linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
In-Reply-To: <20141110083026.GB39688@dtor-ws>

Thanks, Dmitry

> -----Original Message-----
> From: Dmitry Torokhov [mailto:dmitry.torokhov@gmail.com]
> Sent: 2014?11?10? 16:30
> To: Dudley Du
> Cc: rydberg@euromail.se; Dudley Du; bleung@google.com;
> linux-input@vger.kernel.org; linux-kernel@vger.kernel.org
> Subject: Re: [PATCH v9 03/18] input: cyapa: add gen3 trackpad device basic
> functions support
>
> On Mon, Nov 03, 2014 at 04:32:55PM +0800, Dudley Du wrote:
> > Based on the cyapa core, add the gen3 trackpad device's basic functions
> > supported, so gen3 trackpad device can work with kernel input system.
> > The basic function is absolutely same as previous cyapa driver.
> > TEST=test on Chromebooks.
> >
> > Signed-off-by: Dudley Du <dudl@cypress.com>
> > ---
> >  drivers/input/mouse/Makefile     |   3 +-
> >  drivers/input/mouse/cyapa.c      |  90 ++++-
> >  drivers/input/mouse/cyapa.h      |   1 +
> >  drivers/input/mouse/cyapa_gen3.c | 788
> +++++++++++++++++++++++++++++++++++++++
> >  4 files changed, 880 insertions(+), 2 deletions(-)
> >  create mode 100644 drivers/input/mouse/cyapa_gen3.c
> >
> > diff --git a/drivers/input/mouse/Makefile b/drivers/input/mouse/Makefile
> > index dda507f..4bf6c83 100644
> > --- a/drivers/input/mouse/Makefile
> > +++ b/drivers/input/mouse/Makefile
> > @@ -8,7 +8,7 @@ obj-$(CONFIG_MOUSE_AMIGA)+= amimouse.o
> >  obj-$(CONFIG_MOUSE_APPLETOUCH)+= appletouch.o
> >  obj-$(CONFIG_MOUSE_ATARI)+= atarimouse.o
> >  obj-$(CONFIG_MOUSE_BCM5974)+= bcm5974.o
> > -obj-$(CONFIG_MOUSE_CYAPA)+= cyapa.o
> > +obj-$(CONFIG_MOUSE_CYAPA)+= cyapatp.o
> >  obj-$(CONFIG_MOUSE_GPIO)+= gpio_mouse.o
> >  obj-$(CONFIG_MOUSE_INPORT)+= inport.o
> >  obj-$(CONFIG_MOUSE_LOGIBM)+= logibm.o
> > @@ -23,6 +23,7 @@ obj-$(CONFIG_MOUSE_SYNAPTICS_I2C)+= synaptics_i2c.o
> >  obj-$(CONFIG_MOUSE_SYNAPTICS_USB)+= synaptics_usb.o
> >  obj-$(CONFIG_MOUSE_VSXXXAA)+= vsxxxaa.o
> >
> > +cyapatp-objs := cyapa.o cyapa_gen3.o
> >  psmouse-objs := psmouse-base.o synaptics.o focaltech.o
> >
> >  psmouse-$(CONFIG_MOUSE_PS2_ALPS)+= alps.o
> > diff --git a/drivers/input/mouse/cyapa.c b/drivers/input/mouse/cyapa.c
> > index 5029618..cb81baf 100644
> > --- a/drivers/input/mouse/cyapa.c
> > +++ b/drivers/input/mouse/cyapa.c
> > @@ -234,6 +234,9 @@ static int cyapa_check_is_operational(struct cyapa
> *cyapa)
> >  return ret;
> >
> >  switch (cyapa->gen) {
> > +case CYAPA_GEN3:
> > +cyapa->ops = &cyapa_gen3_ops;
> > +break;
> >  default:
> >  return -ENODEV;
> >  }
> > @@ -284,7 +287,85 @@ out:
> >   */
> >  static int cyapa_get_state(struct cyapa *cyapa)
> >  {
> > -return -ENODEV;
> > +int ret;
> > +u8 status[BL_STATUS_SIZE];
> > +u8 cmd[32];
> > +/* The i2c address of gen4 and gen5 trackpad device must be even. */
> > +bool even_addr = ((cyapa->client->addr & 0x0001) == 0);
> > +bool smbus = false;
> > +int retries = 2;
> > +
> > +cyapa->state = CYAPA_STATE_NO_DEVICE;
> > +
> > +/*
> > + * Get trackpad status by reading 3 registers starting from 0.
> > + * If the device is in the bootloader, this will be BL_HEAD.
> > + * If the device is in operation mode, this will be the DATA regs.
> > + *
> > + */
> > +ret = cyapa_i2c_reg_read_block(cyapa, BL_HEAD_OFFSET, BL_STATUS_SIZE,
> > +       status);
> > +
> > +/*
> > + * On smbus systems in OP mode, the i2c_reg_read will fail with
> > + * -ETIMEDOUT.  In this case, try again using the smbus equivalent
> > + * command.  This should return a BL_HEAD indicating CYAPA_STATE_OP.
> > + */
> > +if (cyapa->smbus && (ret == -ETIMEDOUT || ret == -ENXIO)) {
> > +if (!even_addr)
> > +ret = cyapa_read_block(cyapa,
> > +CYAPA_CMD_BL_STATUS, status);
> > +smbus = true;
> > +}
> > +if (ret != BL_STATUS_SIZE)
> > +goto error;
> > +
> > +/*
> > + * Detect trackpad protocol based on characristic registers and bits.
> > + */
> > +do {
> > +cyapa->status[REG_OP_STATUS] = status[REG_OP_STATUS];
> > +cyapa->status[REG_BL_STATUS] = status[REG_BL_STATUS];
> > +cyapa->status[REG_BL_ERROR] = status[REG_BL_ERROR];
> > +
> > +if (cyapa->gen == CYAPA_GEN_UNKNOWN ||
> > +cyapa->gen == CYAPA_GEN3) {
> > +ret = cyapa_gen3_ops.state_parse(cyapa,
> > +status, BL_STATUS_SIZE);
> > +if (ret == 0)
> > +goto out_detected;
> > +}
> > +
> > +/*
> > + * Cannot detect communication protocol based on current
> > + * charateristic registers and bits.
> > + * So write error command to do further detection.
> > + * this method only valid on I2C bus.
> > + * for smbus interface, it won't have overwrite issue.
> > + */
>
> I do not quite understand this, can you re-phrase?

Sorry for the confusion, I means write the command to deivce to reset its status,
so we can try again to detect it correctly.
I would like change the comments to:
/*
 * Write 0x00 0x00 to attached trackpad device to force it update its status registers,
 * so later, can do the detection again.
 */

>
> > +if (!smbus) {
> > +cmd[0] = 0x00;
> > +cmd[1] = 0x00;
> > +ret = cyapa_i2c_write(cyapa, 0, 2, cmd);
> > +if (ret)
> > +goto error;
> > +
> > +msleep(50);
> > +
> > +ret = cyapa_i2c_read(cyapa, BL_HEAD_OFFSET,
> > +BL_STATUS_SIZE, status);
> > +if (ret < 0)
> > +goto error;
> > +}
> > +} while (--retries > 0 && !smbus);
> > +
> > +goto error;
> > +
> > +out_detected:
> > +return 0;
> > +
> > +error:
> > +return (ret < 0) ? ret : -EAGAIN;
> >  }
> >
> >  /*
> > @@ -421,6 +502,8 @@ u16 cyapa_pwr_cmd_to_sleep_time(u8 pwr_mode)
> >   */
> >  static int cyapa_initialize(struct cyapa *cyapa)
> >  {
> > +int ret = 0;
> > +
> >  cyapa->state = CYAPA_STATE_NO_DEVICE;
> >  cyapa->gen = CYAPA_GEN_UNKNOWN;
> >  mutex_init(&cyapa->state_sync_lock);
> > @@ -433,6 +516,11 @@ static int cyapa_initialize(struct cyapa *cyapa)
> >  cyapa->suspend_sleep_time =
> >  cyapa_pwr_cmd_to_sleep_time(cyapa->suspend_power_mode);
> >
> > +if (cyapa_gen3_ops.initialize)
> > +ret = cyapa_gen3_ops.initialize(cyapa);
> > +if (ret)
> > +return ret;
> > +
> >  return cyapa_detect(cyapa);
> >  }
> >
> > diff --git a/drivers/input/mouse/cyapa.h b/drivers/input/mouse/cyapa.h
> > index ee97d7c..b281dcb 100644
> > --- a/drivers/input/mouse/cyapa.h
> > +++ b/drivers/input/mouse/cyapa.h
> > @@ -317,5 +317,6 @@ u16 cyapa_pwr_cmd_to_sleep_time(u8 pwr_mode);
> >
> >
> >  extern const char unique_str[];
> > +extern const struct cyapa_dev_ops cyapa_gen3_ops;
> >
> >  #endif
> > diff --git a/drivers/input/mouse/cyapa_gen3.c
> b/drivers/input/mouse/cyapa_gen3.c
> > new file mode 100644
> > index 0000000..bd00c6e
> > --- /dev/null
> > +++ b/drivers/input/mouse/cyapa_gen3.c
> > @@ -0,0 +1,788 @@
> > +/*
> > + * Cypress APA trackpad with I2C interface
> > + *
> > + * Author: Dudley Du <dudl@cypress.com>
> > + * Further cleanup and restructuring by:
> > + *   Daniel Kurtz <djkurtz@chromium.org>
> > + *   Benson Leung <bleung@chromium.org>
> > + *
> > + * Copyright (C) 2011-2014 Cypress Semiconductor, Inc.
> > + * Copyright (C) 2011-2012 Google, Inc.
> > + *
> > + * This file is subject to the terms and conditions of the GNU General Public
> > + * License.  See the file COPYING in the main directory of this archive for
> > + * more details.
> > + */
> > +
> > +#include <linux/delay.h>
> > +#include <linux/i2c.h>
> > +#include <linux/input.h>
> > +#include <linux/input/mt.h>
> > +#include <linux/module.h>
> > +#include <linux/slab.h>
> > +#include "cyapa.h"
> > +
> > +
> > +#define GEN3_MAX_FINGERS 5
> > +#define GEN3_FINGER_NUM(x) (((x) >> 4) & 0x07)
> > +
> > +#define BLK_HEAD_BYTES 32
> > +
> > +/* Macro for register map group offset. */
> > +#define PRODUCT_ID_SIZE  16
> > +#define QUERY_DATA_SIZE  27
> > +#define REG_PROTOCOL_GEN_QUERY_OFFSET  20
> > +
> > +#define REG_OFFSET_DATA_BASE     0x0000
> > +#define REG_OFFSET_COMMAND_BASE  0x0028
> > +#define REG_OFFSET_QUERY_BASE    0x002a
> > +
> > +#define CYAPA_OFFSET_SOFT_RESET  REG_OFFSET_COMMAND_BASE
> > +#define OP_RECALIBRATION_MASK    0x80
> > +#define OP_REPORT_BASELINE_MASK  0x40
> > +#define REG_OFFSET_MAX_BASELINE  0x0026
> > +#define REG_OFFSET_MIN_BASELINE  0x0027
> > +
> > +#define REG_OFFSET_POWER_MODE (REG_OFFSET_COMMAND_BASE + 1)
> > +#define SET_POWER_MODE_DELAY   10000  /* unit: us */
> > +#define SET_POWER_MODE_TRIES   5
> > +
> > +/*
> > + * CYAPA trackpad device states.
> > + * Used in register 0x00, bit1-0, DeviceStatus field.
> > + * Other values indicate device is in an abnormal state and must be reset.
> > + */
> > +#define CYAPA_DEV_NORMAL  0x03
> > +#define CYAPA_DEV_BUSY    0x01
> > +
> > +#define CYAPA_FW_BLOCK_SIZE64
> > +#define CYAPA_FW_READ_SIZE16
> > +#define CYAPA_FW_HDR_START0x0780
> > +#define CYAPA_FW_HDR_BLOCK_COUNT  2
> > +#define CYAPA_FW_HDR_BLOCK_START  (CYAPA_FW_HDR_START /
> CYAPA_FW_BLOCK_SIZE)
> > +#define CYAPA_FW_HDR_SIZE  (CYAPA_FW_HDR_BLOCK_COUNT * \
> > +CYAPA_FW_BLOCK_SIZE)
> > +#define CYAPA_FW_DATA_START0x0800
> > +#define CYAPA_FW_DATA_BLOCK_COUNT  480
> > +#define CYAPA_FW_DATA_BLOCK_START  (CYAPA_FW_DATA_START /
> CYAPA_FW_BLOCK_SIZE)
> > +#define CYAPA_FW_DATA_SIZE(CYAPA_FW_DATA_BLOCK_COUNT * \
> > + CYAPA_FW_BLOCK_SIZE)
> > +#define CYAPA_FW_SIZE(CYAPA_FW_HDR_SIZE + CYAPA_FW_DATA_SIZE)
> > +#define CYAPA_CMD_LEN16
> > +
> > +#define GEN3_BL_IDLE_FW_MAJ_VER_OFFSET 0x0b
> > +#define GEN3_BL_IDLE_FW_MIN_VER_OFFSET
> (GEN3_BL_IDLE_FW_MAJ_VER_OFFSET + 1)
> > +
> > +
> > +struct cyapa_touch {
> > +/*
> > + * high bits or x/y position value
> > + * bit 7 - 4: high 4 bits of x position value
> > + * bit 3 - 0: high 4 bits of y position value
> > + */
> > +u8 xy_hi;
> > +u8 x_lo;  /* low 8 bits of x position value. */
> > +u8 y_lo;  /* low 8 bits of y position value. */
> > +u8 pressure;
> > +/* id range is 1 - 15.  It is incremented with every new touch. */
> > +u8 id;
> > +} __packed;
> > +
> > +struct cyapa_reg_data {
> > +/*
> > + * bit 0 - 1: device status
> > + * bit 3 - 2: power mode
> > + * bit 6 - 4: reserved
> > + * bit 7: interrupt valid bit
> > + */
> > +u8 device_status;
> > +/*
> > + * bit 7 - 4: number of fingers currently touching pad
> > + * bit 3: valid data check bit
> > + * bit 2: middle mechanism button state if exists
> > + * bit 1: right mechanism button state if exists
> > + * bit 0: left mechanism button state if exists
> > + */
> > +u8 finger_btn;
> > +/* CYAPA reports up to 5 touches per packet. */
> > +struct cyapa_touch touches[5];
> > +} __packed;
> > +
> > +static const u8 bl_activate[] = { 0x00, 0xff, 0x38, 0x00, 0x01, 0x02, 0x03,
> > +0x04, 0x05, 0x06, 0x07 };
> > +static const u8 bl_deactivate[] = { 0x00, 0xff, 0x3b, 0x00, 0x01, 0x02, 0x03,
> > +0x04, 0x05, 0x06, 0x07 };
> > +static const u8 bl_exit[] = { 0x00, 0xff, 0xa5, 0x00, 0x01, 0x02, 0x03, 0x04,
> > +0x05, 0x06, 0x07 };
> > +
> > +
> > + /* for byte read/write command */
> > +#define CMD_RESET      0
> > +#define CMD_POWER_MODE 1
> > +#define CMD_DEV_STATUS 2
> > +#define CMD_REPORT_MAX_BASELINE 3
> > +#define CMD_REPORT_MIN_BASELINE 4
> > +#define SMBUS_BYTE_CMD(cmd) (((cmd) & 0x3f) << 1)
> > +#define CYAPA_SMBUS_RESET         SMBUS_BYTE_CMD(CMD_RESET)
> > +#define CYAPA_SMBUS_POWER_MODE
> SMBUS_BYTE_CMD(CMD_POWER_MODE)
> > +#define CYAPA_SMBUS_DEV_STATUS
> SMBUS_BYTE_CMD(CMD_DEV_STATUS)
> > +#define CYAPA_SMBUS_MAX_BASELINE
> SMBUS_BYTE_CMD(CMD_REPORT_MAX_BASELINE)
> > +#define CYAPA_SMBUS_MIN_BASELINE
> SMBUS_BYTE_CMD(CMD_REPORT_MIN_BASELINE)
> > +
> > + /* for group registers read/write command */
> > +#define REG_GROUP_DATA 0
> > +#define REG_GROUP_CMD 2
> > +#define REG_GROUP_QUERY 3
> > +#define SMBUS_GROUP_CMD(grp) (0x80 | (((grp) & 0x07) << 3))
> > +#define CYAPA_SMBUS_GROUP_DATA
> SMBUS_GROUP_CMD(REG_GROUP_DATA)
> > +#define CYAPA_SMBUS_GROUP_CMD
> SMBUS_GROUP_CMD(REG_GROUP_CMD)
> > +#define CYAPA_SMBUS_GROUP_QUERY
> SMBUS_GROUP_CMD(REG_GROUP_QUERY)
> > +
> > + /* for register block read/write command */
> > +#define CMD_BL_STATUS 0
> > +#define CMD_BL_HEAD 1
> > +#define CMD_BL_CMD 2
> > +#define CMD_BL_DATA 3
> > +#define CMD_BL_ALL 4
> > +#define CMD_BLK_PRODUCT_ID 5
> > +#define CMD_BLK_HEAD 6
> > +#define SMBUS_BLOCK_CMD(cmd) (0xc0 | (((cmd) & 0x1f) << 1))
> > +
> > +/* register block read/write command in bootloader mode */
> > +#define CYAPA_SMBUS_BL_STATUS  SMBUS_BLOCK_CMD(CMD_BL_STATUS)
> > +#define CYAPA_SMBUS_BL_HEAD    SMBUS_BLOCK_CMD(CMD_BL_HEAD)
> > +#define CYAPA_SMBUS_BL_CMD     SMBUS_BLOCK_CMD(CMD_BL_CMD)
> > +#define CYAPA_SMBUS_BL_DATA    SMBUS_BLOCK_CMD(CMD_BL_DATA)
> > +#define CYAPA_SMBUS_BL_ALL     SMBUS_BLOCK_CMD(CMD_BL_ALL)
> > +
> > +/* register block read/write command in operational mode */
> > +#define CYAPA_SMBUS_BLK_PRODUCT_ID
> SMBUS_BLOCK_CMD(CMD_BLK_PRODUCT_ID)
> > +#define CYAPA_SMBUS_BLK_HEAD SMBUS_BLOCK_CMD(CMD_BLK_HEAD)
> > +
> > + /* for byte read/write command */
> > +#define CMD_RESET 0
> > +#define CMD_POWER_MODE 1
> > +#define CMD_DEV_STATUS 2
> > +#define CMD_REPORT_MAX_BASELINE 3
> > +#define CMD_REPORT_MIN_BASELINE 4
> > +#define SMBUS_BYTE_CMD(cmd) (((cmd) & 0x3f) << 1)
> > +#define CYAPA_SMBUS_RESET         SMBUS_BYTE_CMD(CMD_RESET)
> > +#define CYAPA_SMBUS_POWER_MODE
> SMBUS_BYTE_CMD(CMD_POWER_MODE)
> > +#define CYAPA_SMBUS_DEV_STATUS
> SMBUS_BYTE_CMD(CMD_DEV_STATUS)
> > +#define CYAPA_SMBUS_MAX_BASELINE
> SMBUS_BYTE_CMD(CMD_REPORT_MAX_BASELINE)
> > +#define CYAPA_SMBUS_MIN_BASELINE
> SMBUS_BYTE_CMD(CMD_REPORT_MIN_BASELINE)
> > +
> > + /* for group registers read/write command */
> > +#define REG_GROUP_DATA  0
> > +#define REG_GROUP_CMD   2
> > +#define REG_GROUP_QUERY 3
> > +#define SMBUS_GROUP_CMD(grp) (0x80 | (((grp) & 0x07) << 3))
> > +#define CYAPA_SMBUS_GROUP_DATA
> SMBUS_GROUP_CMD(REG_GROUP_DATA)
> > +#define CYAPA_SMBUS_GROUP_CMD
> SMBUS_GROUP_CMD(REG_GROUP_CMD)
> > +#define CYAPA_SMBUS_GROUP_QUERY
> SMBUS_GROUP_CMD(REG_GROUP_QUERY)
> > +
> > + /* for register block read/write command */
> > +#define CMD_BL_STATUS0
> > +#define CMD_BL_HEAD1
> > +#define CMD_BL_CMD2
> > +#define CMD_BL_DATA3
> > +#define CMD_BL_ALL4
> > +#define CMD_BLK_PRODUCT_ID5
> > +#define CMD_BLK_HEAD6
> > +#define SMBUS_BLOCK_CMD(cmd) (0xc0 | (((cmd) & 0x1f) << 1))
> > +
> > +/* register block read/write command in bootloader mode */
> > +#define CYAPA_SMBUS_BL_STATUS SMBUS_BLOCK_CMD(CMD_BL_STATUS)
> > +#define CYAPA_SMBUS_BL_HEAD   SMBUS_BLOCK_CMD(CMD_BL_HEAD)
> > +#define CYAPA_SMBUS_BL_CMD    SMBUS_BLOCK_CMD(CMD_BL_CMD)
> > +#define CYAPA_SMBUS_BL_DATA   SMBUS_BLOCK_CMD(CMD_BL_DATA)
> > +#define CYAPA_SMBUS_BL_ALL    SMBUS_BLOCK_CMD(CMD_BL_ALL)
> > +
> > +/* register block read/write command in operational mode */
> > +#define CYAPA_SMBUS_BLK_PRODUCT_ID
> SMBUS_BLOCK_CMD(CMD_BLK_PRODUCT_ID)
> > +#define CYAPA_SMBUS_BLK_HEAD
> SMBUS_BLOCK_CMD(CMD_BLK_HEAD)
> > +
> > +struct cyapa_cmd_len {
> > +u8 cmd;
> > +u8 len;
> > +};
> > +
> > +/* maps generic CYAPA_CMD_* code to the I2C equivalent */
> > +static const struct cyapa_cmd_len cyapa_i2c_cmds[] = {
> > +{ CYAPA_OFFSET_SOFT_RESET, 1 },/* CYAPA_CMD_SOFT_RESET */
> > +{ REG_OFFSET_COMMAND_BASE + 1, 1 },/* CYAPA_CMD_POWER_MODE
> */
> > +{ REG_OFFSET_DATA_BASE, 1 },/* CYAPA_CMD_DEV_STATUS */
> > +{ REG_OFFSET_DATA_BASE, sizeof(struct cyapa_reg_data) },
> > +/* CYAPA_CMD_GROUP_DATA */
> > +{ REG_OFFSET_COMMAND_BASE, 0 },/* CYAPA_CMD_GROUP_CMD */
> > +{ REG_OFFSET_QUERY_BASE, QUERY_DATA_SIZE }, /*
> CYAPA_CMD_GROUP_QUERY */
> > +{ BL_HEAD_OFFSET, 3 },/* CYAPA_CMD_BL_STATUS */
> > +{ BL_HEAD_OFFSET, 16 },/* CYAPA_CMD_BL_HEAD */
> > +{ BL_HEAD_OFFSET, 16 },/* CYAPA_CMD_BL_CMD */
> > +{ BL_DATA_OFFSET, 16 },/* CYAPA_CMD_BL_DATA */
> > +{ BL_HEAD_OFFSET, 32 },/* CYAPA_CMD_BL_ALL */
> > +{ REG_OFFSET_QUERY_BASE, PRODUCT_ID_SIZE },
> > +/* CYAPA_CMD_BLK_PRODUCT_ID */
> > +{ REG_OFFSET_DATA_BASE, 32 },/* CYAPA_CMD_BLK_HEAD */
> > +{ REG_OFFSET_MAX_BASELINE, 1 },/* CYAPA_CMD_MAX_BASELINE
> */
> > +{ REG_OFFSET_MIN_BASELINE, 1 },/* CYAPA_CMD_MIN_BASELINE
> */
> > +};
> > +
> > +static const struct cyapa_cmd_len cyapa_smbus_cmds[] = {
> > +{ CYAPA_SMBUS_RESET, 1 },/* CYAPA_CMD_SOFT_RESET */
> > +{ CYAPA_SMBUS_POWER_MODE, 1 },/* CYAPA_CMD_POWER_MODE
> */
> > +{ CYAPA_SMBUS_DEV_STATUS, 1 },/* CYAPA_CMD_DEV_STATUS */
> > +{ CYAPA_SMBUS_GROUP_DATA, sizeof(struct cyapa_reg_data) },
> > +/* CYAPA_CMD_GROUP_DATA */
> > +{ CYAPA_SMBUS_GROUP_CMD, 2 },/* CYAPA_CMD_GROUP_CMD */
> > +{ CYAPA_SMBUS_GROUP_QUERY, QUERY_DATA_SIZE },
> > +/* CYAPA_CMD_GROUP_QUERY */
> > +{ CYAPA_SMBUS_BL_STATUS, 3 },/* CYAPA_CMD_BL_STATUS */
> > +{ CYAPA_SMBUS_BL_HEAD, 16 },/* CYAPA_CMD_BL_HEAD */
> > +{ CYAPA_SMBUS_BL_CMD, 16 },/* CYAPA_CMD_BL_CMD */
> > +{ CYAPA_SMBUS_BL_DATA, 16 },/* CYAPA_CMD_BL_DATA */
> > +{ CYAPA_SMBUS_BL_ALL, 32 },/* CYAPA_CMD_BL_ALL */
> > +{ CYAPA_SMBUS_BLK_PRODUCT_ID, PRODUCT_ID_SIZE },
> > +/* CYAPA_CMD_BLK_PRODUCT_ID */
> > +{ CYAPA_SMBUS_BLK_HEAD, 16 },/* CYAPA_CMD_BLK_HEAD */
> > +{ CYAPA_SMBUS_MAX_BASELINE, 1 },/* CYAPA_CMD_MAX_BASELINE */
> > +{ CYAPA_SMBUS_MIN_BASELINE, 1 },/* CYAPA_CMD_MIN_BASELINE */
> > +};
> > +
> > +static bool data_reporting_started;
>
> Why is this a global?

Thanks, it should not be global, I will fix it and included in the gen3 private data.

>
> > +
> > +
> > +/*
> > + * cyapa_smbus_read_block - perform smbus block read command
> > + * @cyapa  - private data structure of the driver
> > + * @cmd    - the properly encoded smbus command
> > + * @len    - expected length of smbus command result
> > + * @values - buffer to store smbus command result
> > + *
> > + * Returns negative errno, else the number of bytes written.
> > + *
> > + * Note:
> > + * In trackpad device, the memory block allocated for I2C register map
> > + * is 256 bytes, so the max read block for I2C bus is 256 bytes.
> > + */
> > +ssize_t cyapa_smbus_read_block(struct cyapa *cyapa, u8 cmd, size_t len,
> > +      u8 *values)
> > +{
> > +ssize_t ret;
> > +u8 index;
> > +u8 smbus_cmd;
> > +u8 *buf;
> > +struct i2c_client *client = cyapa->client;
> > +
> > +if (!(SMBUS_BYTE_BLOCK_CMD_MASK & cmd))
> > +return -EINVAL;
> > +
> > +if (SMBUS_GROUP_BLOCK_CMD_MASK & cmd) {
> > +/* read specific block registers command. */
> > +smbus_cmd = SMBUS_ENCODE_RW(cmd, SMBUS_READ);
> > +ret = i2c_smbus_read_block_data(client, smbus_cmd, values);
> > +goto out;
> > +}
> > +
> > +ret = 0;
> > +for (index = 0; index * I2C_SMBUS_BLOCK_MAX < len; index++) {
> > +smbus_cmd = SMBUS_ENCODE_IDX(cmd, index);
> > +smbus_cmd = SMBUS_ENCODE_RW(smbus_cmd, SMBUS_READ);
> > +buf = values + I2C_SMBUS_BLOCK_MAX * index;
> > +ret = i2c_smbus_read_block_data(client, smbus_cmd, buf);
> > +if (ret < 0)
> > +goto out;
> > +}
> > +
> > +out:
> > +return ret > 0 ? len : ret;
> > +}
> > +
> > +s32 cyapa_read_byte(struct cyapa *cyapa, u8 cmd_idx)
> > +{
> > +u8 cmd;
> > +
> > +if (cyapa->smbus) {
> > +cmd = cyapa_smbus_cmds[cmd_idx].cmd;
> > +cmd = SMBUS_ENCODE_RW(cmd, SMBUS_READ);
> > +} else {
> > +cmd = cyapa_i2c_cmds[cmd_idx].cmd;
> > +}
> > +return i2c_smbus_read_byte_data(cyapa->client, cmd);
> > +}
> > +
> > +s32 cyapa_write_byte(struct cyapa *cyapa, u8 cmd_idx, u8 value)
> > +{
> > +u8 cmd;
> > +
> > +if (cyapa->smbus) {
> > +cmd = cyapa_smbus_cmds[cmd_idx].cmd;
> > +cmd = SMBUS_ENCODE_RW(cmd, SMBUS_WRITE);
> > +} else {
> > +cmd = cyapa_i2c_cmds[cmd_idx].cmd;
> > +}
> > +return i2c_smbus_write_byte_data(cyapa->client, cmd, value);
> > +}
> > +
> > +ssize_t cyapa_read_block(struct cyapa *cyapa, u8 cmd_idx, u8 *values)
> > +{
> > +u8 cmd;
> > +size_t len;
> > +
> > +if (cyapa->smbus) {
> > +cmd = cyapa_smbus_cmds[cmd_idx].cmd;
> > +len = cyapa_smbus_cmds[cmd_idx].len;
> > +return cyapa_smbus_read_block(cyapa, cmd, len, values);
> > +}
> > +cmd = cyapa_i2c_cmds[cmd_idx].cmd;
> > +len = cyapa_i2c_cmds[cmd_idx].len;
> > +return cyapa_i2c_reg_read_block(cyapa, cmd, len, values);
> > +}
> > +
> > +/*
> > + * Determine the Gen3 trackpad device's current operating state.
> > + *
> > + */
> > +static int cyapa_gen3_state_parse(struct cyapa *cyapa, u8 *reg_data, int len)
> > +{
> > +/*
> > + * Must be in detecting and should not do data reporting.
> > + * It will be reenabled when all detecting done and lauched into
> > + * applicaiton mode successfully.
> > + */
> > +data_reporting_started = false;
> > +cyapa->state = CYAPA_STATE_NO_DEVICE;
> > +
> > +/* Parse based on Gen3 characteristic registers and bits */
> > +if (reg_data[REG_BL_FILE] == BL_FILE &&
> > +reg_data[REG_BL_ERROR] == BL_ERROR_NO_ERR_IDLE &&
> > +(reg_data[REG_BL_STATUS] ==
> > +(BL_STATUS_RUNNING | BL_STATUS_CSUM_VALID) ||
> > +reg_data[REG_BL_STATUS] == BL_STATUS_RUNNING)) {
> > +/*
> > + * Normal state after power on or reset,
> > + * REG_BL_STATUS == 0x11, firmware image checksum is valid.
> > + * REG_BL_STATUS == 0x10, firmware image checksum is invalid.
> > + */
> > +cyapa->gen = CYAPA_GEN3;
> > +cyapa->state = CYAPA_STATE_BL_IDLE;
> > +} else if (reg_data[REG_BL_FILE] == BL_FILE &&
> > +(reg_data[REG_BL_STATUS] & BL_STATUS_RUNNING) ==
> > +BL_STATUS_RUNNING) {
> > +cyapa->gen = CYAPA_GEN3;
> > +if (reg_data[REG_BL_STATUS] & BL_STATUS_BUSY) {
> > +cyapa->state = CYAPA_STATE_BL_BUSY;
> > +} else {
> > +if ((reg_data[REG_BL_ERROR] & BL_ERROR_BOOTLOADING) ==
> > +BL_ERROR_BOOTLOADING)
> > +cyapa->state = CYAPA_STATE_BL_ACTIVE;
> > +else
> > +cyapa->state = CYAPA_STATE_BL_IDLE;
> > +}
> > +} else if ((reg_data[REG_OP_STATUS] & OP_STATUS_SRC) &&
> > +(reg_data[REG_OP_DATA1] & OP_DATA_VALID)) {
> > +/*
> > + * Normal state when running in operaitonal mode,
> > + * may also not in full power state or
> > + * busying in command process.
> > + */
> > +if (GEN3_FINGER_NUM(reg_data[REG_OP_DATA1]) <=
> > +GEN3_MAX_FINGERS) {
> > +/* Finger number data is valid. */
> > +cyapa->gen = CYAPA_GEN3;
> > +cyapa->state = CYAPA_STATE_OP;
> > +}
> > +} else if (reg_data[REG_OP_STATUS] == 0x0C &&
> > +reg_data[REG_OP_DATA1] == 0x08) {
> > +/* Op state when first two registers overwritten with 0x00 */
> > +cyapa->gen = CYAPA_GEN3;
> > +cyapa->state = CYAPA_STATE_OP;
> > +} else if (reg_data[REG_BL_STATUS] &
> > +(BL_STATUS_RUNNING | BL_STATUS_BUSY)) {
> > +cyapa->gen = CYAPA_GEN3;
> > +cyapa->state = CYAPA_STATE_BL_BUSY;
> > +}
> > +
> > +if (cyapa->gen == CYAPA_GEN3 && (cyapa->state == CYAPA_STATE_OP ||
> > +cyapa->state == CYAPA_STATE_BL_IDLE ||
> > +cyapa->state == CYAPA_STATE_BL_ACTIVE ||
> > +cyapa->state == CYAPA_STATE_BL_BUSY))
> > +return 0;
> > +
> > +return -EAGAIN;
> > +}
> > +
> > +static int cyapa_gen3_bl_deactivate(struct cyapa *cyapa)
> > +{
> > +int ret;
> > +
> > +ret = cyapa_i2c_reg_write_block(cyapa, 0, sizeof(bl_deactivate),
> > +bl_deactivate);
> > +if (ret < 0)
> > +return ret;
> > +
> > +/* Wait for bootloader to switch to idle state; should take < 100ms */
> > +msleep(100);
> > +ret = cyapa_poll_state(cyapa, 500);
> > +if (ret < 0)
> > +return ret;
> > +if (cyapa->state != CYAPA_STATE_BL_IDLE)
> > +return -EAGAIN;
> > +return 0;
> > +}
> > +
> > +/*
> > + * Exit bootloader
> > + *
> > + * Send bl_exit command, then wait 50 - 100 ms to let device transition to
> > + * operational mode.  If this is the first time the device's firmware is
> > + * running, it can take up to 2 seconds to calibrate its sensors.  So, poll
> > + * the device's new state for up to 2 seconds.
> > + *
> > + * Returns:
> > + *   -EIO    failure while reading from device
> > + *   -EAGAIN device is stuck in bootloader, b/c it has invalid firmware
> > + *   0       device is supported and in operational mode
> > + */
> > +static int cyapa_gen3_bl_exit(struct cyapa *cyapa)
> > +{
> > +int ret;
> > +
> > +ret = cyapa_i2c_reg_write_block(cyapa, 0, sizeof(bl_exit), bl_exit);
> > +if (ret < 0)
> > +return ret;
> > +
> > +/*
> > + * Wait for bootloader to exit, and operation mode to start.
> > + * Normally, this takes at least 50 ms.
> > + */
> > +usleep_range(50000, 100000);
> > +/*
> > + * In addition, when a device boots for the first time after being
> > + * updated to new firmware, it must first calibrate its sensors, which
> > + * can take up to an additional 2 seconds. If the device power is
> > + * running low, this may take even longer.
> > + */
> > +ret = cyapa_poll_state(cyapa, 4000);
> > +if (ret < 0)
> > +return ret;
> > +if (cyapa->state != CYAPA_STATE_OP)
> > +return -EAGAIN;
> > +
> > +return 0;
> > +}
> > +
> > +/*
> > + * cyapa_get_wait_time_for_pwr_cmd
> > + *
> > + * Compute the amount of time we need to wait after updating the touchpad
> > + * power mode. The touchpad needs to consume the incoming power mode set
> > + * command at the current clock rate.
> > + */
> > +
> > +static u16 cyapa_get_wait_time_for_pwr_cmd(u8 pwr_mode)
> > +{
> > +switch (pwr_mode) {
> > +case PWR_MODE_FULL_ACTIVE: return 20;
> > +case PWR_MODE_BTN_ONLY: return 20;
> > +case PWR_MODE_OFF: return 20;
> > +default: return cyapa_pwr_cmd_to_sleep_time(pwr_mode) + 50;
> > +}
> > +}
> > +
> > +/*
> > + * Set device power mode
> > + *
> > + * Write to the field to configure power state. Power states include :
> > + *   Full : Max scans and report rate.
> > + *   Idle : Report rate set by user specified time.
> > + *   ButtonOnly : No scans for fingers. When the button is triggered,
> > + *     a slave interrupt is asserted to notify host to wake up.
> > + *   Off : Only awake for i2c commands from host. No function for button
> > + *     or touch sensors.
> > + *
> > + * The power_mode command should conform to the following :
> > + *   Full : 0x3f
> > + *   Idle : Configurable from 20 to 1000ms. See note below for
> > + *     cyapa_sleep_time_to_pwr_cmd and cyapa_pwr_cmd_to_sleep_time
> > + *   ButtonOnly : 0x01
> > + *   Off : 0x00
> > + *
> > + * Device power mode can only be set when device is in operational mode.
> > + */
> > +static int cyapa_gen3_set_power_mode(struct cyapa *cyapa, u8 power_mode,
> > +u16 always_unused)
> > +{
> > +int ret;
> > +u8 power;
> > +int tries = SET_POWER_MODE_TRIES;
> > +u16 sleep_time;
> > +
> > +always_unused = 0;
> > +if (cyapa->state != CYAPA_STATE_OP)
> > +return 0;
> > +
> > +while (true) {
> > +ret = cyapa_read_byte(cyapa, CYAPA_CMD_POWER_MODE);
> > +if (ret >= 0 || --tries < 1)
> > +break;
> > +usleep_range(SET_POWER_MODE_DELAY, 2 *
> SET_POWER_MODE_DELAY);
> > +}
> > +if (ret < 0)
> > +return ret;
> > +
> > +/*
> > + * Return early if the power mode to set is the same as the current
> > + * one.
> > + */
> > +if ((ret & PWR_MODE_MASK) == power_mode)
> > +return 0;
> > +
> > +sleep_time = cyapa_get_wait_time_for_pwr_cmd(ret & PWR_MODE_MASK);
> > +power = ret;
> > +power &= ~PWR_MODE_MASK;
> > +power |= power_mode & PWR_MODE_MASK;
> > +while (true) {
> > +ret = cyapa_write_byte(cyapa, CYAPA_CMD_POWER_MODE, power);
> > +if (!ret || --tries < 1)
> > +break;
> > +usleep_range(SET_POWER_MODE_DELAY, 2 *
> SET_POWER_MODE_DELAY);
> > +}
> > +
> > +/*
> > + * Wait for the newly set power command to go in at the previous
> > + * clock speed (scanrate) used by the touchpad firmware. Not
> > + * doing so before issuing the next command may result in errors
> > + * depending on the command's content.
> > + */
> > +msleep(sleep_time);
> > +return ret;
> > +}
> > +
> > +static int cyapa_gen3_get_query_data(struct cyapa *cyapa)
> > +{
> > +u8 query_data[QUERY_DATA_SIZE];
> > +int ret;
> > +
> > +if (cyapa->state != CYAPA_STATE_OP)
> > +return -EBUSY;
> > +
> > +ret = cyapa_read_block(cyapa, CYAPA_CMD_GROUP_QUERY, query_data);
> > +if (ret != QUERY_DATA_SIZE)
> > +return (ret < 0) ? ret : -EIO;
> > +
> > +memcpy(&cyapa->product_id[0], &query_data[0], 5);
> > +cyapa->product_id[5] = '-';
> > +memcpy(&cyapa->product_id[6], &query_data[5], 6);
> > +cyapa->product_id[12] = '-';
> > +memcpy(&cyapa->product_id[13], &query_data[11], 2);
> > +cyapa->product_id[15] = '\0';
> > +
> > +cyapa->fw_maj_ver = query_data[15];
> > +cyapa->fw_min_ver = query_data[16];
> > +
> > +cyapa->btn_capability = query_data[19] & CAPABILITY_BTN_MASK;
> > +
> > +cyapa->gen = query_data[20] & 0x0f;
> > +
> > +cyapa->max_abs_x = ((query_data[21] & 0xf0) << 4) | query_data[22];
> > +cyapa->max_abs_y = ((query_data[21] & 0x0f) << 8) | query_data[23];
> > +
> > +cyapa->physical_size_x =
> > +((query_data[24] & 0xf0) << 4) | query_data[25];
> > +cyapa->physical_size_y =
> > +((query_data[24] & 0x0f) << 8) | query_data[26];
> > +
> > +cyapa->max_z = 255;
> > +
> > +return 0;
> > +}
> > +
> > +static int cyapa_gen3_bl_query_data(struct cyapa *cyapa)
> > +{
> > +u8 bl_data[CYAPA_CMD_LEN];
> > +int ret;
> > +
> > +ret = cyapa_i2c_reg_read_block(cyapa, 0, CYAPA_CMD_LEN, bl_data);
> > +if (ret != CYAPA_CMD_LEN)
> > +return (ret < 0) ? ret : -EIO;
> > +
> > +/*
> > + * This value will be updated again when entered application mode.
> > + * If TP failed to enter application mode, this fw version values
> > + * can be used as a reference.
> > + * This firmware version valid when fw image checksum is valid.
> > + */
> > +if (bl_data[REG_BL_STATUS] ==
> > +(BL_STATUS_RUNNING | BL_STATUS_CSUM_VALID)) {
> > +cyapa->fw_maj_ver = bl_data[GEN3_BL_IDLE_FW_MAJ_VER_OFFSET];
> > +cyapa->fw_min_ver = bl_data[GEN3_BL_IDLE_FW_MIN_VER_OFFSET];
> > +}
> > +
> > +return 0;
> > +}
> > +
> > +/*
> > + * Check if device is operational.
> > + *
> > + * An operational device is responding, has exited bootloader, and has
> > + * firmware supported by this driver.
> > + *
> > + * Returns:
> > + *   -EBUSY  no device or in bootloader
> > + *   -EIO    failure while reading from device
> > + *   -EAGAIN device is still in bootloader
> > + *           if ->state = CYAPA_STATE_BL_IDLE, device has invalid firmware
> > + *   -EINVAL device is in operational mode, but not supported by this driver
> > + *   0       device is supported
> > + */
> > +static int cyapa_gen3_do_operational_check(struct cyapa *cyapa)
> > +{
> > +struct device *dev = &cyapa->client->dev;
> > +int ret;
> > +
> > +switch (cyapa->state) {
> > +case CYAPA_STATE_BL_ACTIVE:
> > +ret = cyapa_gen3_bl_deactivate(cyapa);
> > +if (ret) {
> > +dev_err(dev, "failed to bl_deactivate. %d\n", ret);
> > +return ret;
> > +}
> > +
> > +/* Fallthrough state */
> > +case CYAPA_STATE_BL_IDLE:
> > +/* Try to get firmware version in bootloader mode. */
> > +cyapa_gen3_bl_query_data(cyapa);
> > +
> > +ret = cyapa_gen3_bl_exit(cyapa);
> > +if (ret) {
> > +dev_err(dev, "failed to bl_exit. %d\n", ret);
> > +return ret;
> > +}
> > +
> > +/* Fallthrough state */
> > +case CYAPA_STATE_OP:
> > +/*
> > + * Reading query data before going back to the full mode
> > + * may cause problems, so we set the power mode first here.
> > + */
> > +ret = cyapa_gen3_set_power_mode(cyapa, PWR_MODE_FULL_ACTIVE,
> 0);
> > +if (ret)
> > +dev_err(dev, "%s: set full power mode failed, (%d)\n",
> > +__func__, ret);
> > +ret = cyapa_gen3_get_query_data(cyapa);
> > +if (ret < 0)
> > +return ret;
> > +
> > +/* Only support firmware protocol gen3 */
> > +if (cyapa->gen != CYAPA_GEN3) {
> > +dev_err(dev, "unsupported protocol version (%d)",
> > +cyapa->gen);
> > +return -EINVAL;
> > +}
> > +
> > +/* Only support product ID starting with CYTRA */
> > +if (memcmp(cyapa->product_id, unique_str,
> > +strlen(unique_str)) != 0) {
> > +dev_err(dev, "unsupported product ID (%s)\n",
> > +cyapa->product_id);
> > +return -EINVAL;
> > +}
> > +
> > +data_reporting_started = true;
> > +return 0;
> > +
> > +default:
> > +return -EIO;
> > +}
> > +return 0;
> > +}
> > +
> > +/*
> > + * Return false, do not continue process
> > + * Return true, continue process.
> > + */
> > +static bool cyapa_gen3_irq_cmd_handler(struct cyapa *cyapa)
> > +{
> > +/* Not gen3 irq command response, skip for continue. */
> > +if (cyapa->gen != CYAPA_GEN3)
> > +return true;
> > +
> > +if (cyapa->input && data_reporting_started)
> > +return true;
> > +
> > +/*
> > + * Driver in detecting or other interface function processing,
> > + * so, stop cyapa_gen3_irq_handler to continue process to
> > + * avoid unwanted to error detecting and processing.
> > + *
> > + * And also, avoid the periodicly accerted interrupts to be processed
> > + * as touch inputs when gen3 failed to launch into application mode,
> > + * which will cause gen3 stays in bootloader mode.
> > + */
> > +return false;
> > +}
> > +
> > +static int cyapa_gen3_irq_handler(struct cyapa *cyapa)
> > +{
> > +struct input_dev *input = cyapa->input;
> > +struct device *dev = &cyapa->client->dev;
> > +struct cyapa_reg_data data;
> > +int i;
> > +int ret;
> > +int num_fingers;
> > +
> > +ret = cyapa_read_block(cyapa, CYAPA_CMD_GROUP_DATA, (u8 *)&data);
> > +if (ret != sizeof(data)) {
> > +dev_err(dev, "failed to read report data, (%d)\n", ret);
> > +return -EINVAL;
> > +}
> > +
> > +if ((data.device_status & OP_STATUS_SRC) != OP_STATUS_SRC ||
> > +    (data.device_status & OP_STATUS_DEV) != CYAPA_DEV_NORMAL ||
> > +    (data.finger_btn & OP_DATA_VALID) != OP_DATA_VALID) {
> > +dev_err(dev, "invalid device state bytes, %02x %02x\n",
> > +data.device_status, data.finger_btn);
> > +return -EINVAL;
> > +}
> > +
> > +num_fingers = (data.finger_btn >> 4) & 0x0f;
> > +for (i = 0; i < num_fingers; i++) {
> > +const struct cyapa_touch *touch = &data.touches[i];
> > +/* Note: touch->id range is 1 to 15; slots are 0 to 14. */
> > +int slot = touch->id - 1;
> > +
> > +input_mt_slot(input, slot);
> > +input_mt_report_slot_state(input, MT_TOOL_FINGER, true);
> > +input_report_abs(input, ABS_MT_POSITION_X,
> > + ((touch->xy_hi & 0xf0) << 4) | touch->x_lo);
> > +input_report_abs(input, ABS_MT_POSITION_Y,
> > + ((touch->xy_hi & 0x0f) << 8) | touch->y_lo);
> > +input_report_abs(input, ABS_MT_PRESSURE, touch->pressure);
> > +}
> > +
> > +input_mt_sync_frame(input);
> > +
> > +if (cyapa->btn_capability & CAPABILITY_LEFT_BTN_MASK)
> > +input_report_key(input, BTN_LEFT,
> > + !!(data.finger_btn & OP_DATA_LEFT_BTN));
> > +if (cyapa->btn_capability & CAPABILITY_MIDDLE_BTN_MASK)
> > +input_report_key(input, BTN_MIDDLE,
> > + !!(data.finger_btn & OP_DATA_MIDDLE_BTN));
> > +if (cyapa->btn_capability & CAPABILITY_RIGHT_BTN_MASK)
> > +input_report_key(input, BTN_RIGHT,
> > + !!(data.finger_btn & OP_DATA_RIGHT_BTN));
> > +input_sync(input);
> > +
> > +return 0;
> > +}
> > +
> > +const struct cyapa_dev_ops cyapa_gen3_ops = {
> > +.state_parse = cyapa_gen3_state_parse,
> > +.operational_check = cyapa_gen3_do_operational_check,
> > +
> > +.irq_handler = cyapa_gen3_irq_handler,
> > +.irq_cmd_handler = cyapa_gen3_irq_cmd_handler,
> > +
> > +.set_power_mode = cyapa_gen3_set_power_mode,
> > +};
> > --
> > 1.9.1
> >
>
> --
> Dmitry

This message and any attachments may contain Cypress (or its subsidiaries) confidential information. If it has been received in error, please advise the sender and immediately delete this message.

^ permalink raw reply

* RE: [PATCH v9 02/18] input: cyapa: re-design driver to support multi-trackpad in one driver
From: Dudley Du @ 2014-11-10 11:04 UTC (permalink / raw)
  To: Dmitry Torokhov, Dudley Du
  Cc: rydberg@euromail.se, bleung@google.com,
	linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
In-Reply-To: <20141110081838.GA39688@dtor-ws>

Thanks, Dmitry

> -----Original Message-----
> From: Dmitry Torokhov [mailto:dmitry.torokhov@gmail.com]
> Sent: 2014?11?10? 16:19
> To: Dudley Du
> Cc: rydberg@euromail.se; Dudley Du; bleung@google.com;
> linux-input@vger.kernel.org; linux-kernel@vger.kernel.org
> Subject: Re: [PATCH v9 02/18] input: cyapa: re-design driver to support
> multi-trackpad in one driver
>
> Hi Dudley,
>
> On Mon, Nov 03, 2014 at 04:32:54PM +0800, Dudley Du wrote:
> > In order to support multiple different chipsets and communication protocols
> > trackpad devices in one cyapa driver, the new cyapa driver is re-designed
> > with one cyapa driver core and multiple device specific functions component.
> > The cyapa driver core is contained in this patch, it supplies basic functions
> > that working with kernel and input subsystem, and also supplies the interfaces
> > that the specific devices' component can connect and work together with as
> > one driver.
> >
> > Signed-off-by: Dudley Du <dudl@cypress.com>
>
> Thank you for addressing my previous comments, the driver looks much
> better now. Still, a few comments.
>
> We should try to avoid breaking the driver withing the patch series, so
> please merge this change together with the next patch re-adding the gen3
> support. The gen5 is new functionality and can stay in separate
> patch(es).

Thanks for your review and comments.
I will re-adding the gen3 support in next upstream.

>
> > ---
> >  drivers/input/mouse/cyapa.c | 1087 ++++++++++++++-----------------------------
> >  drivers/input/mouse/cyapa.h |  321 +++++++++++++
> >  2 files changed, 682 insertions(+), 726 deletions(-)
> >  create mode 100644 drivers/input/mouse/cyapa.h
> >
> > diff --git a/drivers/input/mouse/cyapa.c b/drivers/input/mouse/cyapa.c
> > index b3d7a2a..5029618 100644
> > --- a/drivers/input/mouse/cyapa.c
> > +++ b/drivers/input/mouse/cyapa.c
> > @@ -6,7 +6,7 @@
> >   *   Daniel Kurtz <djkurtz@chromium.org>
> >   *   Benson Leung <bleung@chromium.org>
> >   *
> > - * Copyright (C) 2011-2012 Cypress Semiconductor, Inc.
> > + * Copyright (C) 2011-2014 Cypress Semiconductor, Inc.
> >   * Copyright (C) 2011-2012 Google, Inc.
> >   *
> >   * This file is subject to the terms and conditions of the GNU General Public
> > @@ -20,601 +20,193 @@
> >  #include <linux/input/mt.h>
> >  #include <linux/interrupt.h>
> >  #include <linux/module.h>
> > +#include <linux/mutex.h>
> >  #include <linux/slab.h>
> > +#include <linux/uaccess.h>
> > +#include "cyapa.h"
> >
> > -/* APA trackpad firmware generation */
> > -#define CYAPA_GEN3   0x03   /* support MT-protocol B with tracking ID. */
> > -
> > -#define CYAPA_NAME   "Cypress APA Trackpad (cyapa)"
> > -
> > -/* commands for read/write registers of Cypress trackpad */
> > -#define CYAPA_CMD_SOFT_RESET       0x00
> > -#define CYAPA_CMD_POWER_MODE       0x01
> > -#define CYAPA_CMD_DEV_STATUS       0x02
> > -#define CYAPA_CMD_GROUP_DATA       0x03
> > -#define CYAPA_CMD_GROUP_CMD        0x04
> > -#define CYAPA_CMD_GROUP_QUERY      0x05
> > -#define CYAPA_CMD_BL_STATUS        0x06
> > -#define CYAPA_CMD_BL_HEAD          0x07
> > -#define CYAPA_CMD_BL_CMD           0x08
> > -#define CYAPA_CMD_BL_DATA          0x09
> > -#define CYAPA_CMD_BL_ALL           0x0a
> > -#define CYAPA_CMD_BLK_PRODUCT_ID   0x0b
> > -#define CYAPA_CMD_BLK_HEAD         0x0c
> > -
> > -/* report data start reg offset address. */
> > -#define DATA_REG_START_OFFSET  0x0000
> > -
> > -#define BL_HEAD_OFFSET 0x00
> > -#define BL_DATA_OFFSET 0x10
> > -
> > -/*
> > - * Operational Device Status Register
> > - *
> > - * bit 7: Valid interrupt source
> > - * bit 6 - 4: Reserved
> > - * bit 3 - 2: Power status
> > - * bit 1 - 0: Device status
> > - */
> > -#define REG_OP_STATUS     0x00
> > -#define OP_STATUS_SRC     0x80
> > -#define OP_STATUS_POWER   0x0c
> > -#define OP_STATUS_DEV     0x03
> > -#define OP_STATUS_MASK (OP_STATUS_SRC | OP_STATUS_POWER |
> OP_STATUS_DEV)
> > -
> > -/*
> > - * Operational Finger Count/Button Flags Register
> > - *
> > - * bit 7 - 4: Number of touched finger
> > - * bit 3: Valid data
> > - * bit 2: Middle Physical Button
> > - * bit 1: Right Physical Button
> > - * bit 0: Left physical Button
> > - */
> > -#define REG_OP_DATA1       0x01
> > -#define OP_DATA_VALID      0x08
> > -#define OP_DATA_MIDDLE_BTN 0x04
> > -#define OP_DATA_RIGHT_BTN  0x02
> > -#define OP_DATA_LEFT_BTN   0x01
> > -#define OP_DATA_BTN_MASK (OP_DATA_MIDDLE_BTN | OP_DATA_RIGHT_BTN
> | \
> > -  OP_DATA_LEFT_BTN)
> > -
> > -/*
> > - * Bootloader Status Register
> > - *
> > - * bit 7: Busy
> > - * bit 6 - 5: Reserved
> > - * bit 4: Bootloader running
> > - * bit 3 - 1: Reserved
> > - * bit 0: Checksum valid
> > - */
> > -#define REG_BL_STATUS        0x01
> > -#define BL_STATUS_BUSY       0x80
> > -#define BL_STATUS_RUNNING    0x10
> > -#define BL_STATUS_DATA_VALID 0x08
> > -#define BL_STATUS_CSUM_VALID 0x01
> > -
> > -/*
> > - * Bootloader Error Register
> > - *
> > - * bit 7: Invalid
> > - * bit 6: Invalid security key
> > - * bit 5: Bootloading
> > - * bit 4: Command checksum
> > - * bit 3: Flash protection error
> > - * bit 2: Flash checksum error
> > - * bit 1 - 0: Reserved
> > - */
> > -#define REG_BL_ERROR         0x02
> > -#define BL_ERROR_INVALID     0x80
> > -#define BL_ERROR_INVALID_KEY 0x40
> > -#define BL_ERROR_BOOTLOADING 0x20
> > -#define BL_ERROR_CMD_CSUM    0x10
> > -#define BL_ERROR_FLASH_PROT  0x08
> > -#define BL_ERROR_FLASH_CSUM  0x04
> > -
> > -#define BL_STATUS_SIZE  3  /* length of bootloader status registers */
> > -#define BLK_HEAD_BYTES 32
> > -
> > -#define PRODUCT_ID_SIZE  16
> > -#define QUERY_DATA_SIZE  27
> > -#define REG_PROTOCOL_GEN_QUERY_OFFSET  20
> > -
> > -#define REG_OFFSET_DATA_BASE     0x0000
> > -#define REG_OFFSET_COMMAND_BASE  0x0028
> > -#define REG_OFFSET_QUERY_BASE    0x002a
> > -
> > -#define CAPABILITY_LEFT_BTN_MASK(0x01 << 3)
> > -#define CAPABILITY_RIGHT_BTN_MASK(0x01 << 4)
> > -#define CAPABILITY_MIDDLE_BTN_MASK(0x01 << 5)
> > -#define CAPABILITY_BTN_MASK  (CAPABILITY_LEFT_BTN_MASK | \
> > -      CAPABILITY_RIGHT_BTN_MASK | \
> > -      CAPABILITY_MIDDLE_BTN_MASK)
> > -
> > -#define CYAPA_OFFSET_SOFT_RESET  REG_OFFSET_COMMAND_BASE
> > -
> > -#define REG_OFFSET_POWER_MODE (REG_OFFSET_COMMAND_BASE + 1)
> > -
> > -#define PWR_MODE_MASK   0xfc
> > -#define PWR_MODE_FULL_ACTIVE (0x3f << 2)
> > -#define PWR_MODE_IDLE        (0x05 << 2) /* default sleep time is 50 ms. */
> > -#define PWR_MODE_OFF         (0x00 << 2)
> > -
> > -#define PWR_STATUS_MASK      0x0c
> > -#define PWR_STATUS_ACTIVE    (0x03 << 2)
> > -#define PWR_STATUS_IDLE      (0x02 << 2)
> > -#define PWR_STATUS_OFF       (0x00 << 2)
> > -
> > -/*
> > - * CYAPA trackpad device states.
> > - * Used in register 0x00, bit1-0, DeviceStatus field.
> > - * Other values indicate device is in an abnormal state and must be reset.
> > - */
> > -#define CYAPA_DEV_NORMAL  0x03
> > -#define CYAPA_DEV_BUSY    0x01
> > -
> > -enum cyapa_state {
> > -CYAPA_STATE_OP,
> > -CYAPA_STATE_BL_IDLE,
> > -CYAPA_STATE_BL_ACTIVE,
> > -CYAPA_STATE_BL_BUSY,
> > -CYAPA_STATE_NO_DEVICE,
> > -};
> > -
> > -
> > -struct cyapa_touch {
> > -/*
> > - * high bits or x/y position value
> > - * bit 7 - 4: high 4 bits of x position value
> > - * bit 3 - 0: high 4 bits of y position value
> > - */
> > -u8 xy_hi;
> > -u8 x_lo;  /* low 8 bits of x position value. */
> > -u8 y_lo;  /* low 8 bits of y position value. */
> > -u8 pressure;
> > -/* id range is 1 - 15.  It is incremented with every new touch. */
> > -u8 id;
> > -} __packed;
> > -
> > -/* The touch.id is used as the MT slot id, thus max MT slot is 15 */
> > -#define CYAPA_MAX_MT_SLOTS  15
> > -
> > -struct cyapa_reg_data {
> > -/*
> > - * bit 0 - 1: device status
> > - * bit 3 - 2: power mode
> > - * bit 6 - 4: reserved
> > - * bit 7: interrupt valid bit
> > - */
> > -u8 device_status;
> > -/*
> > - * bit 7 - 4: number of fingers currently touching pad
> > - * bit 3: valid data check bit
> > - * bit 2: middle mechanism button state if exists
> > - * bit 1: right mechanism button state if exists
> > - * bit 0: left mechanism button state if exists
> > - */
> > -u8 finger_btn;
> > -/* CYAPA reports up to 5 touches per packet. */
> > -struct cyapa_touch touches[5];
> > -} __packed;
> > -
> > -/* The main device structure */
> > -struct cyapa {
> > -enum cyapa_state state;
> > -
> > -struct i2c_client *client;
> > -struct input_dev *input;
> > -char phys[32];/* device physical location */
> > -int irq;
> > -bool irq_wake;  /* irq wake is enabled */
> > -bool smbus;
> > -
> > -/* read from query data region. */
> > -char product_id[16];
> > -u8 btn_capability;
> > -u8 gen;
> > -int max_abs_x;
> > -int max_abs_y;
> > -int physical_size_x;
> > -int physical_size_y;
> > -};
> > -
> > -static const u8 bl_deactivate[] = { 0x00, 0xff, 0x3b, 0x00, 0x01, 0x02, 0x03,
> > -0x04, 0x05, 0x06, 0x07 };
> > -static const u8 bl_exit[] = { 0x00, 0xff, 0xa5, 0x00, 0x01, 0x02, 0x03, 0x04,
> > -0x05, 0x06, 0x07 };
> > -
> > -struct cyapa_cmd_len {
> > -u8 cmd;
> > -u8 len;
> > -};
> >
> >  #define CYAPA_ADAPTER_FUNC_NONE   0
> >  #define CYAPA_ADAPTER_FUNC_I2C    1
> >  #define CYAPA_ADAPTER_FUNC_SMBUS  2
> >  #define CYAPA_ADAPTER_FUNC_BOTH   3
> >
> > -/*
> > - * macros for SMBus communication
> > - */
> > -#define SMBUS_READ   0x01
> > -#define SMBUS_WRITE 0x00
> > -#define SMBUS_ENCODE_IDX(cmd, idx) ((cmd) | (((idx) & 0x03) << 1))
> > -#define SMBUS_ENCODE_RW(cmd, rw) ((cmd) | ((rw) & 0x01))
> > -#define SMBUS_BYTE_BLOCK_CMD_MASK 0x80
> > -#define SMBUS_GROUP_BLOCK_CMD_MASK 0x40
> > -
> > - /* for byte read/write command */
> > -#define CMD_RESET 0
> > -#define CMD_POWER_MODE 1
> > -#define CMD_DEV_STATUS 2
> > -#define SMBUS_BYTE_CMD(cmd) (((cmd) & 0x3f) << 1)
> > -#define CYAPA_SMBUS_RESET SMBUS_BYTE_CMD(CMD_RESET)
> > -#define CYAPA_SMBUS_POWER_MODE
> SMBUS_BYTE_CMD(CMD_POWER_MODE)
> > -#define CYAPA_SMBUS_DEV_STATUS SMBUS_BYTE_CMD(CMD_DEV_STATUS)
> > -
> > - /* for group registers read/write command */
> > -#define REG_GROUP_DATA 0
> > -#define REG_GROUP_CMD 2
> > -#define REG_GROUP_QUERY 3
> > -#define SMBUS_GROUP_CMD(grp) (0x80 | (((grp) & 0x07) << 3))
> > -#define CYAPA_SMBUS_GROUP_DATA
> SMBUS_GROUP_CMD(REG_GROUP_DATA)
> > -#define CYAPA_SMBUS_GROUP_CMD
> SMBUS_GROUP_CMD(REG_GROUP_CMD)
> > -#define CYAPA_SMBUS_GROUP_QUERY
> SMBUS_GROUP_CMD(REG_GROUP_QUERY)
> > -
> > - /* for register block read/write command */
> > -#define CMD_BL_STATUS 0
> > -#define CMD_BL_HEAD 1
> > -#define CMD_BL_CMD 2
> > -#define CMD_BL_DATA 3
> > -#define CMD_BL_ALL 4
> > -#define CMD_BLK_PRODUCT_ID 5
> > -#define CMD_BLK_HEAD 6
> > -#define SMBUS_BLOCK_CMD(cmd) (0xc0 | (((cmd) & 0x1f) << 1))
> > -
> > -/* register block read/write command in bootloader mode */
> > -#define CYAPA_SMBUS_BL_STATUS SMBUS_BLOCK_CMD(CMD_BL_STATUS)
> > -#define CYAPA_SMBUS_BL_HEAD SMBUS_BLOCK_CMD(CMD_BL_HEAD)
> > -#define CYAPA_SMBUS_BL_CMD SMBUS_BLOCK_CMD(CMD_BL_CMD)
> > -#define CYAPA_SMBUS_BL_DATA SMBUS_BLOCK_CMD(CMD_BL_DATA)
> > -#define CYAPA_SMBUS_BL_ALL SMBUS_BLOCK_CMD(CMD_BL_ALL)
> > -
> > -/* register block read/write command in operational mode */
> > -#define CYAPA_SMBUS_BLK_PRODUCT_ID
> SMBUS_BLOCK_CMD(CMD_BLK_PRODUCT_ID)
> > -#define CYAPA_SMBUS_BLK_HEAD SMBUS_BLOCK_CMD(CMD_BLK_HEAD)
> > -
> > -static const struct cyapa_cmd_len cyapa_i2c_cmds[] = {
> > -{ CYAPA_OFFSET_SOFT_RESET, 1 },
> > -{ REG_OFFSET_COMMAND_BASE + 1, 1 },
> > -{ REG_OFFSET_DATA_BASE, 1 },
> > -{ REG_OFFSET_DATA_BASE, sizeof(struct cyapa_reg_data) },
> > -{ REG_OFFSET_COMMAND_BASE, 0 },
> > -{ REG_OFFSET_QUERY_BASE, QUERY_DATA_SIZE },
> > -{ BL_HEAD_OFFSET, 3 },
> > -{ BL_HEAD_OFFSET, 16 },
> > -{ BL_HEAD_OFFSET, 16 },
> > -{ BL_DATA_OFFSET, 16 },
> > -{ BL_HEAD_OFFSET, 32 },
> > -{ REG_OFFSET_QUERY_BASE, PRODUCT_ID_SIZE },
> > -{ REG_OFFSET_DATA_BASE, 32 }
> > -};
> > +#define CYAPA_DEBUGFS_READ_FW"read_fw"
> > +#define CYAPA_DEBUGFS_RAW_DATA"raw_data"
> > +#define CYAPA_FW_NAME"cyapa.bin"
>
> These do not seem to belong to the current patch, please introduce them
> only when you need them.

Thanks, I will fix it in next upstream.

>
> > +
> > +const char unique_str[] = "CYTRA";
> >
> > -static const struct cyapa_cmd_len cyapa_smbus_cmds[] = {
> > -{ CYAPA_SMBUS_RESET, 1 },
> > -{ CYAPA_SMBUS_POWER_MODE, 1 },
> > -{ CYAPA_SMBUS_DEV_STATUS, 1 },
> > -{ CYAPA_SMBUS_GROUP_DATA, sizeof(struct cyapa_reg_data) },
> > -{ CYAPA_SMBUS_GROUP_CMD, 2 },
> > -{ CYAPA_SMBUS_GROUP_QUERY, QUERY_DATA_SIZE },
> > -{ CYAPA_SMBUS_BL_STATUS, 3 },
> > -{ CYAPA_SMBUS_BL_HEAD, 16 },
> > -{ CYAPA_SMBUS_BL_CMD, 16 },
> > -{ CYAPA_SMBUS_BL_DATA, 16 },
> > -{ CYAPA_SMBUS_BL_ALL, 32 },
> > -{ CYAPA_SMBUS_BLK_PRODUCT_ID, PRODUCT_ID_SIZE },
> > -{ CYAPA_SMBUS_BLK_HEAD, 16 },
> > -};
> >
> > -static ssize_t cyapa_i2c_reg_read_block(struct cyapa *cyapa, u8 reg, size_t len,
> > +ssize_t cyapa_i2c_reg_read_block(struct cyapa *cyapa, u8 reg, size_t len,
> >  u8 *values)
> >  {
> >  return i2c_smbus_read_i2c_block_data(cyapa->client, reg, len, values);
> >  }
> >
> > -static ssize_t cyapa_i2c_reg_write_block(struct cyapa *cyapa, u8 reg,
> > +ssize_t cyapa_i2c_reg_write_block(struct cyapa *cyapa, u8 reg,
> >   size_t len, const u8 *values)
> >  {
> >  return i2c_smbus_write_i2c_block_data(cyapa->client, reg, len, values);
> >  }
> >
> > -/*
> > - * cyapa_smbus_read_block - perform smbus block read command
> > - * @cyapa  - private data structure of the driver
> > - * @cmd    - the properly encoded smbus command
> > - * @len    - expected length of smbus command result
> > - * @values - buffer to store smbus command result
> > - *
> > - * Returns negative errno, else the number of bytes written.
> > - *
> > - * Note:
> > - * In trackpad device, the memory block allocated for I2C register map
> > - * is 256 bytes, so the max read block for I2C bus is 256 bytes.
> > - */
> > -static ssize_t cyapa_smbus_read_block(struct cyapa *cyapa, u8 cmd, size_t len,
> > -      u8 *values)
> > -{
> > -ssize_t ret;
> > -u8 index;
> > -u8 smbus_cmd;
> > -u8 *buf;
> > -struct i2c_client *client = cyapa->client;
> > -
> > -if (!(SMBUS_BYTE_BLOCK_CMD_MASK & cmd))
> > -return -EINVAL;
> > -
> > -if (SMBUS_GROUP_BLOCK_CMD_MASK & cmd) {
> > -/* read specific block registers command. */
> > -smbus_cmd = SMBUS_ENCODE_RW(cmd, SMBUS_READ);
> > -ret = i2c_smbus_read_block_data(client, smbus_cmd, values);
> > -goto out;
> > -}
> > -
> > -ret = 0;
> > -for (index = 0; index * I2C_SMBUS_BLOCK_MAX < len; index++) {
> > -smbus_cmd = SMBUS_ENCODE_IDX(cmd, index);
> > -smbus_cmd = SMBUS_ENCODE_RW(smbus_cmd, SMBUS_READ);
> > -buf = values + I2C_SMBUS_BLOCK_MAX * index;
> > -ret = i2c_smbus_read_block_data(client, smbus_cmd, buf);
> > -if (ret < 0)
> > -goto out;
> > -}
> > -
> > -out:
> > -return ret > 0 ? len : ret;
> > -}
> > -
> > -static s32 cyapa_read_byte(struct cyapa *cyapa, u8 cmd_idx)
> > -{
> > -u8 cmd;
> > -
> > -if (cyapa->smbus) {
> > -cmd = cyapa_smbus_cmds[cmd_idx].cmd;
> > -cmd = SMBUS_ENCODE_RW(cmd, SMBUS_READ);
> > -} else {
> > -cmd = cyapa_i2c_cmds[cmd_idx].cmd;
> > -}
> > -return i2c_smbus_read_byte_data(cyapa->client, cmd);
> > -}
> > -
> > -static s32 cyapa_write_byte(struct cyapa *cyapa, u8 cmd_idx, u8 value)
> > -{
> > -u8 cmd;
> > -
> > -if (cyapa->smbus) {
> > -cmd = cyapa_smbus_cmds[cmd_idx].cmd;
> > -cmd = SMBUS_ENCODE_RW(cmd, SMBUS_WRITE);
> > -} else {
> > -cmd = cyapa_i2c_cmds[cmd_idx].cmd;
> > -}
> > -return i2c_smbus_write_byte_data(cyapa->client, cmd, value);
> > -}
> > -
> > -static ssize_t cyapa_read_block(struct cyapa *cyapa, u8 cmd_idx, u8 *values)
> > -{
> > -u8 cmd;
> > -size_t len;
> > -
> > -if (cyapa->smbus) {
> > -cmd = cyapa_smbus_cmds[cmd_idx].cmd;
> > -len = cyapa_smbus_cmds[cmd_idx].len;
> > -return cyapa_smbus_read_block(cyapa, cmd, len, values);
> > -}
> > -
> > -cmd = cyapa_i2c_cmds[cmd_idx].cmd;
> > -len = cyapa_i2c_cmds[cmd_idx].len;
> > -return cyapa_i2c_reg_read_block(cyapa, cmd, len, values);
> > -}
> > -
> > -/*
> > - * Query device for its current operating state.
> > - *
> > - */
> > -static int cyapa_get_state(struct cyapa *cyapa)
> > +/* Returns 0 on success, else negative errno on failure. */
> > +ssize_t cyapa_i2c_read(struct cyapa *cyapa, u8 reg, size_t len,
> > +u8 *values)
> >  {
> >  int ret;
> > -u8 status[BL_STATUS_SIZE];
> > -
> > -cyapa->state = CYAPA_STATE_NO_DEVICE;
> > -
> > -/*
> > - * Get trackpad status by reading 3 registers starting from 0.
> > - * If the device is in the bootloader, this will be BL_HEAD.
> > - * If the device is in operation mode, this will be the DATA regs.
> > - *
> > - */
> > -ret = cyapa_i2c_reg_read_block(cyapa, BL_HEAD_OFFSET, BL_STATUS_SIZE,
> > -       status);
> > -
> > -/*
> > - * On smbus systems in OP mode, the i2c_reg_read will fail with
> > - * -ETIMEDOUT.  In this case, try again using the smbus equivalent
> > - * command.  This should return a BL_HEAD indicating CYAPA_STATE_OP.
> > - */
> > -if (cyapa->smbus && (ret == -ETIMEDOUT || ret == -ENXIO))
> > -ret = cyapa_read_block(cyapa, CYAPA_CMD_BL_STATUS, status);
> > -
> > -if (ret != BL_STATUS_SIZE)
> > -goto error;
> > -
> > -if ((status[REG_OP_STATUS] & OP_STATUS_SRC) == OP_STATUS_SRC) {
> > -switch (status[REG_OP_STATUS] & OP_STATUS_DEV) {
> > -case CYAPA_DEV_NORMAL:
> > -case CYAPA_DEV_BUSY:
> > -cyapa->state = CYAPA_STATE_OP;
> > -break;
> > -default:
> > -ret = -EAGAIN;
> > -goto error;
> > -}
> > -} else {
> > -if (status[REG_BL_STATUS] & BL_STATUS_BUSY)
> > -cyapa->state = CYAPA_STATE_BL_BUSY;
> > -else if (status[REG_BL_ERROR] & BL_ERROR_BOOTLOADING)
> > -cyapa->state = CYAPA_STATE_BL_ACTIVE;
> > -else
> > -cyapa->state = CYAPA_STATE_BL_IDLE;
> > -}
> > +struct i2c_client *client = cyapa->client;
> > +struct i2c_msg msgs[] = {
> > +{
> > +.addr = client->addr,
> > +.flags = 0,
> > +.len = 1,
> > +.buf = &reg,
> > +},
> > +{
> > +.addr = client->addr,
> > +.flags = I2C_M_RD,
> > +.len = len,
> > +.buf = values,
> > +},
> > +};
> > +
> > +ret = i2c_transfer(client->adapter, msgs, 2);
> > +
> > +if (ret != ARRAY_SIZE(msgs))
> > +return ret < 0 ? ret : -EIO;
> >
> >  return 0;
> > -error:
> > -return (ret < 0) ? ret : -EAGAIN;
> >  }
> >
> > -/*
> > - * Poll device for its status in a loop, waiting up to timeout for a response.
> > - *
> > - * When the device switches state, it usually takes ~300 ms.
> > - * However, when running a new firmware image, the device must calibrate its
> > - * sensors, which can take as long as 2 seconds.
> > +/**
> > + * cyapa_i2c_write - Execute i2c block data write operation
> > + * @cyapa: Handle to this driver
> > + * @ret: Offset of the data to written in the register map
> > + * @len: number of bytes to write
> > + * @values: Data to be written
> >   *
> > - * Note: The timeout has granularity of the polling rate, which is 100 ms.
> > - *
> > - * Returns:
> > - *   0 when the device eventually responds with a valid non-busy state.
> > - *   -ETIMEDOUT if device never responds (too many -EAGAIN)
> > - *   < 0    other errors
> > + * Return negative errno code on error; return zero when success.
> >   */
> > -static int cyapa_poll_state(struct cyapa *cyapa, unsigned int timeout)
> > +ssize_t cyapa_i2c_write(struct cyapa *cyapa, u8 reg,
> > + size_t len, const void *values)
> >  {
> >  int ret;
> > -int tries = timeout / 100;
> > -
> > -ret = cyapa_get_state(cyapa);
> > -while ((ret || cyapa->state >= CYAPA_STATE_BL_BUSY) && tries--) {
> > -msleep(100);
> > -ret = cyapa_get_state(cyapa);
> > -}
> > -return (ret == -EAGAIN || ret == -ETIMEDOUT) ? -ETIMEDOUT : ret;
> > -}
> > -
> > -static int cyapa_bl_deactivate(struct cyapa *cyapa)
> > -{
> > -int ret;
> > -
> > -ret = cyapa_i2c_reg_write_block(cyapa, 0, sizeof(bl_deactivate),
> > -bl_deactivate);
> > -if (ret < 0)
> > -return ret;
> > -
> > -/* wait for bootloader to switch to idle state; should take < 100ms */
> > -msleep(100);
> > -ret = cyapa_poll_state(cyapa, 500);
> > -if (ret < 0)
> > -return ret;
> > -if (cyapa->state != CYAPA_STATE_BL_IDLE)
> > -return -EAGAIN;
> > -return 0;
> > +struct i2c_client *client = cyapa->client;
> > +char data[32], *buf;
> > +
> > +if (len > 31) {
> > +buf = kzalloc(len + 1, GFP_KERNEL);
> > +if (!buf)
> > +return -ENOMEM;
> > +} else
> > +buf = data;
> > +
> > +buf[0] = reg;
> > +memcpy(&buf[1], values, len);
> > +ret = i2c_master_send(client, buf, len + 1);
> > +
> > +if (buf != data)
> > +kfree(buf);
> > +return (ret == (len + 1)) ? 0 : ((ret < 0) ? ret : -EIO);
> >  }
> >
> > -/*
> > - * Exit bootloader
> > - *
> > - * Send bl_exit command, then wait 50 - 100 ms to let device transition to
> > - * operational mode.  If this is the first time the device's firmware is
> > - * running, it can take up to 2 seconds to calibrate its sensors.  So, poll
> > - * the device's new state for up to 2 seconds.
> > - *
> > - * Returns:
> > - *   -EIO    failure while reading from device
> > - *   -EAGAIN device is stuck in bootloader, b/c it has invalid firmware
> > - *   0       device is supported and in operational mode
> > - */
> > -static int cyapa_bl_exit(struct cyapa *cyapa)
> > +static u8 cyapa_check_adapter_functionality(struct i2c_client *client)
> >  {
> > -int ret;
> > -
> > -ret = cyapa_i2c_reg_write_block(cyapa, 0, sizeof(bl_exit), bl_exit);
> > -if (ret < 0)
> > -return ret;
> > -
> > -/*
> > - * Wait for bootloader to exit, and operation mode to start.
> > - * Normally, this takes at least 50 ms.
> > - */
> > -usleep_range(50000, 100000);
> > -/*
> > - * In addition, when a device boots for the first time after being
> > - * updated to new firmware, it must first calibrate its sensors, which
> > - * can take up to an additional 2 seconds.
> > - */
> > -ret = cyapa_poll_state(cyapa, 2000);
> > -if (ret < 0)
> > -return ret;
> > -if (cyapa->state != CYAPA_STATE_OP)
> > -return -EAGAIN;
> > +u8 ret = CYAPA_ADAPTER_FUNC_NONE;
> >
> > -return 0;
> > +if (i2c_check_functionality(client->adapter, I2C_FUNC_I2C))
> > +ret |= CYAPA_ADAPTER_FUNC_I2C;
> > +if (i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA |
> > +     I2C_FUNC_SMBUS_BLOCK_DATA |
> > +     I2C_FUNC_SMBUS_I2C_BLOCK))
> > +ret |= CYAPA_ADAPTER_FUNC_SMBUS;
> > +return ret;
> >  }
> >
> > -/*
> > - * Set device power mode
> > - *
> > - */
> > -static int cyapa_set_power_mode(struct cyapa *cyapa, u8 power_mode)
> > +static int cyapa_create_input_dev(struct cyapa *cyapa)
> >  {
> >  struct device *dev = &cyapa->client->dev;
> >  int ret;
> > -u8 power;
> > +struct input_dev *input;
> >
> > -if (cyapa->state != CYAPA_STATE_OP)
> > -return 0;
> > +if (!cyapa->physical_size_x || !cyapa->physical_size_y)
> > +return -EINVAL;
> >
> > -ret = cyapa_read_byte(cyapa, CYAPA_CMD_POWER_MODE);
> > -if (ret < 0)
> > -return ret;
> > +input = cyapa->input = devm_input_allocate_device(dev);
> > +if (!input) {
> > +dev_err(dev, "failed to allocate memory for input device.\n");
> > +return -ENOMEM;
> > +}
> >
> > -power = ret & ~PWR_MODE_MASK;
> > -power |= power_mode & PWR_MODE_MASK;
> > -ret = cyapa_write_byte(cyapa, CYAPA_CMD_POWER_MODE, power);
> > -if (ret < 0)
> > -dev_err(dev, "failed to set power_mode 0x%02x err = %d\n",
> > -power_mode, ret);
> > -return ret;
> > -}
> > +input->name = CYAPA_NAME;
> > +input->phys = cyapa->phys;
> > +input->id.bustype = BUS_I2C;
> > +input->id.version = 1;
> > +input->id.product = 0;  /* Means any product in eventcomm. */
> > +input->dev.parent = &cyapa->client->dev;
> >
> > -static int cyapa_get_query_data(struct cyapa *cyapa)
> > -{
> > -u8 query_data[QUERY_DATA_SIZE];
> > -int ret;
> > +input_set_drvdata(input, cyapa);
> >
> > -if (cyapa->state != CYAPA_STATE_OP)
> > -return -EBUSY;
> > +__set_bit(EV_ABS, input->evbit);
> >
> > -ret = cyapa_read_block(cyapa, CYAPA_CMD_GROUP_QUERY, query_data);
> > -if (ret < 0)
> > -return ret;
> > -if (ret != QUERY_DATA_SIZE)
> > -return -EIO;
> > +/* Finger position */
> > +input_set_abs_params(input, ABS_MT_POSITION_X, 0, cyapa->max_abs_x, 0,
> > +     0);
> > +input_set_abs_params(input, ABS_MT_POSITION_Y, 0, cyapa->max_abs_y, 0,
> > +     0);
> > +input_set_abs_params(input, ABS_MT_PRESSURE, 0, cyapa->max_z, 0, 0);
> > +if (cyapa->gen > CYAPA_GEN3) {
> > +input_set_abs_params(input, ABS_MT_TOUCH_MAJOR, 0, 255, 0, 0);
> > +input_set_abs_params(input, ABS_MT_TOUCH_MINOR, 0, 255, 0, 0);
> > +/*
> > + * Orientation is the angle between the vertical axis and
> > + * the major axis of the contact ellipse.
> > + * The range is -127 to 127.
> > + * the positive direction is clockwise form the vertical axis.
> > + * If the ellipse of contact degenerates into a circle,
> > + * orientation is reported as 0.
> > + *
> > + * Also, for Gen5 trackpad the accurate of this orientation
> > + * value is value + (-30 ~ 30).
> > + */
> > +input_set_abs_params(input, ABS_MT_ORIENTATION,
> > +-127, 127, 0, 0);
> > +}
> > +if (cyapa->gen >= CYAPA_GEN5) {
> > +input_set_abs_params(input, ABS_MT_WIDTH_MAJOR, 0, 255, 0, 0);
> > +input_set_abs_params(input, ABS_MT_WIDTH_MINOR, 0, 255, 0, 0);
> > +}
> >
> > -memcpy(&cyapa->product_id[0], &query_data[0], 5);
> > -cyapa->product_id[5] = '-';
> > -memcpy(&cyapa->product_id[6], &query_data[5], 6);
> > -cyapa->product_id[12] = '-';
> > -memcpy(&cyapa->product_id[13], &query_data[11], 2);
> > -cyapa->product_id[15] = '\0';
> > +input_abs_set_res(input, ABS_MT_POSITION_X,
> > +  cyapa->max_abs_x / cyapa->physical_size_x);
> > +input_abs_set_res(input, ABS_MT_POSITION_Y,
> > +  cyapa->max_abs_y / cyapa->physical_size_y);
> >
> > -cyapa->btn_capability = query_data[19] & CAPABILITY_BTN_MASK;
> > +if (cyapa->btn_capability & CAPABILITY_LEFT_BTN_MASK)
> > +__set_bit(BTN_LEFT, input->keybit);
> > +if (cyapa->btn_capability & CAPABILITY_MIDDLE_BTN_MASK)
> > +__set_bit(BTN_MIDDLE, input->keybit);
> > +if (cyapa->btn_capability & CAPABILITY_RIGHT_BTN_MASK)
> > +__set_bit(BTN_RIGHT, input->keybit);
> >
> > -cyapa->gen = query_data[20] & 0x0f;
> > +if (cyapa->btn_capability == CAPABILITY_LEFT_BTN_MASK)
> > +__set_bit(INPUT_PROP_BUTTONPAD, input->propbit);
> >
> > -cyapa->max_abs_x = ((query_data[21] & 0xf0) << 4) | query_data[22];
> > -cyapa->max_abs_y = ((query_data[21] & 0x0f) << 8) | query_data[23];
> > +/* Handle pointer emulation and unused slots in core */
> > +ret = input_mt_init_slots(input, CYAPA_MAX_MT_SLOTS,
> > +  INPUT_MT_POINTER | INPUT_MT_DROP_UNUSED);
> > +if (ret) {
> > +dev_err(dev, "failed to initialize MT slots, %d\n", ret);
> > +return ret;
> > +}
> >
> > -cyapa->physical_size_x =
> > -((query_data[24] & 0xf0) << 4) | query_data[25];
> > -cyapa->physical_size_y =
> > -((query_data[24] & 0x0f) << 8) | query_data[26];
> > +/* Register the device in input subsystem */
> > +ret = input_register_device(input);
> > +if (ret) {
> > +dev_err(dev, "failed to register input device, %d\n", ret);
> > +return ret;
> > +}
> >
> >  return 0;
> >  }
> > @@ -635,192 +227,213 @@ static int cyapa_get_query_data(struct cyapa
> *cyapa)
> >   */
> >  static int cyapa_check_is_operational(struct cyapa *cyapa)
> >  {
> > -struct device *dev = &cyapa->client->dev;
> > -static const char unique_str[] = "CYTRA";
> >  int ret;
> >
> > -ret = cyapa_poll_state(cyapa, 2000);
> > -if (ret < 0)
> > +ret = cyapa_poll_state(cyapa, 4000);
> > +if (ret)
> >  return ret;
> > -switch (cyapa->state) {
> > -case CYAPA_STATE_BL_ACTIVE:
> > -ret = cyapa_bl_deactivate(cyapa);
> > -if (ret)
> > -return ret;
> > -
> > -/* Fallthrough state */
> > -case CYAPA_STATE_BL_IDLE:
> > -ret = cyapa_bl_exit(cyapa);
> > -if (ret)
> > -return ret;
> > -
> > -/* Fallthrough state */
> > -case CYAPA_STATE_OP:
> > -ret = cyapa_get_query_data(cyapa);
> > -if (ret < 0)
> > -return ret;
> > -
> > -/* only support firmware protocol gen3 */
> > -if (cyapa->gen != CYAPA_GEN3) {
> > -dev_err(dev, "unsupported protocol version (%d)",
> > -cyapa->gen);
> > -return -EINVAL;
> > -}
> > -
> > -/* only support product ID starting with CYTRA */
> > -if (memcmp(cyapa->product_id, unique_str,
> > -   sizeof(unique_str) - 1) != 0) {
> > -dev_err(dev, "unsupported product ID (%s)\n",
> > -cyapa->product_id);
> > -return -EINVAL;
> > -}
> > -return 0;
> >
> > +switch (cyapa->gen) {
> >  default:
> > -return -EIO;
> > +return -ENODEV;
> >  }
> > -return 0;
> > +
> > +if (cyapa->ops->operational_check)
> > +ret = cyapa->ops->operational_check(cyapa);
> > +
> > +return ret;
> >  }
> >
> > +
> >  static irqreturn_t cyapa_irq(int irq, void *dev_id)
> >  {
> >  struct cyapa *cyapa = dev_id;
> >  struct device *dev = &cyapa->client->dev;
> >  struct input_dev *input = cyapa->input;
> > -struct cyapa_reg_data data;
> > -int i;
> > +bool cont;
> >  int ret;
> > -int num_fingers;
> >
> >  if (device_may_wakeup(dev))
> >  pm_wakeup_event(dev, 0);
> >
> > -ret = cyapa_read_block(cyapa, CYAPA_CMD_GROUP_DATA, (u8 *)&data);
> > -if (ret != sizeof(data))
> > -goto out;
> > -
> > -if ((data.device_status & OP_STATUS_SRC) != OP_STATUS_SRC ||
> > -    (data.device_status & OP_STATUS_DEV) != CYAPA_DEV_NORMAL ||
> > -    (data.finger_btn & OP_DATA_VALID) != OP_DATA_VALID) {
> > -goto out;
> > -}
> > -
> > -num_fingers = (data.finger_btn >> 4) & 0x0f;
> > -for (i = 0; i < num_fingers; i++) {
> > -const struct cyapa_touch *touch = &data.touches[i];
> > -/* Note: touch->id range is 1 to 15; slots are 0 to 14. */
> > -int slot = touch->id - 1;
> > -
> > -input_mt_slot(input, slot);
> > -input_mt_report_slot_state(input, MT_TOOL_FINGER, true);
> > -input_report_abs(input, ABS_MT_POSITION_X,
> > - ((touch->xy_hi & 0xf0) << 4) | touch->x_lo);
> > -input_report_abs(input, ABS_MT_POSITION_Y,
> > - ((touch->xy_hi & 0x0f) << 8) | touch->y_lo);
> > -input_report_abs(input, ABS_MT_PRESSURE, touch->pressure);
> > +/* Interrupt event maybe cuased by host command to trackpad device. */
> > +cont = true;
> > +if (cyapa->ops->irq_cmd_handler)
> > +cont = cyapa->ops->irq_cmd_handler(cyapa);
> > +
> > +/* Interrupt event maybe from trackpad device input reporting. */
> > +if (cont && cyapa->ops->irq_handler) {
> > +if (!input || cyapa->ops->irq_handler(cyapa)) {
> > +ret = mutex_lock_interruptible(&cyapa->state_sync_lock);
> > +if (ret && cyapa->ops->sort_empty_output_data) {
> > +cyapa->ops->sort_empty_output_data(cyapa,
> > +NULL, NULL, NULL);
> > +goto out;
> > +}
> > +cyapa_detect(cyapa);
> > +mutex_unlock(&cyapa->state_sync_lock);
> > +}
> >  }
> >
> > -input_mt_sync_frame(input);
> > -
> > -if (cyapa->btn_capability & CAPABILITY_LEFT_BTN_MASK)
> > -input_report_key(input, BTN_LEFT,
> > - data.finger_btn & OP_DATA_LEFT_BTN);
> > -
> > -if (cyapa->btn_capability & CAPABILITY_MIDDLE_BTN_MASK)
> > -input_report_key(input, BTN_MIDDLE,
> > - data.finger_btn & OP_DATA_MIDDLE_BTN);
> > -
> > -if (cyapa->btn_capability & CAPABILITY_RIGHT_BTN_MASK)
> > -input_report_key(input, BTN_RIGHT,
> > - data.finger_btn & OP_DATA_RIGHT_BTN);
> > -
> > -input_sync(input);
> > -
> >  out:
> >  return IRQ_HANDLED;
> >  }
> >
> > -static u8 cyapa_check_adapter_functionality(struct i2c_client *client)
> > +/*
> > + * Query device for its current operating state.
> > + */
> > +static int cyapa_get_state(struct cyapa *cyapa)
> >  {
> > -u8 ret = CYAPA_ADAPTER_FUNC_NONE;
> > +return -ENODEV;
> > +}
> >
> > -if (i2c_check_functionality(client->adapter, I2C_FUNC_I2C))
> > -ret |= CYAPA_ADAPTER_FUNC_I2C;
> > -if (i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA |
> > -     I2C_FUNC_SMBUS_BLOCK_DATA |
> > -     I2C_FUNC_SMBUS_I2C_BLOCK))
> > -ret |= CYAPA_ADAPTER_FUNC_SMBUS;
> > -return ret;
> > +/*
> > + * Poll device for its status in a loop, waiting up to timeout for a response.
> > + *
> > + * When the device switches state, it usually takes ~300 ms.
> > + * However, when running a new firmware image, the device must calibrate its
> > + * sensors, which can take as long as 2 seconds.
> > + *
> > + * Note: The timeout has granularity of the polling rate, which is 100 ms.
> > + *
> > + * Returns:
> > + *   0 when the device eventually responds with a valid non-busy state.
> > + *   -ETIMEDOUT if device never responds (too many -EAGAIN)
> > + *   < 0    other errors
> > + */
> > +int cyapa_poll_state(struct cyapa *cyapa, unsigned int timeout)
> > +{
> > +int ret;
> > +int tries = timeout / 100;
> > +
> > +ret = cyapa_get_state(cyapa);
> > +while ((ret || cyapa->state <= CYAPA_STATE_BL_BUSY) && tries--) {
> > +msleep(100);
> > +ret = cyapa_get_state(cyapa);
> > +}
> > +
> > +return (ret == -EAGAIN || ret == -ETIMEDOUT) ? -ETIMEDOUT : ret;
> >  }
> >
> > -static int cyapa_create_input_dev(struct cyapa *cyapa)
> > +/*
> > + * Returns:
> > + *   0    when device is detected, and operatioinal.
> > + *   > 0  when device is detected, but not operational.
> > + *   < 0  when device is not detected, or other errors.
> > + *          e.g.: IO communication error with the device.
> > + */
> > +int cyapa_detect(struct cyapa *cyapa)
>
> We have cyapa->state. Can we check it to see if device is operational or
> not? Or introduce another variable instead of returning tristate from
> cyapa_detect?

Do you mean in cyapa_detect() method, just get the result of operational or not?
If not operational, then in other method to get the detail state of the device, right?


>
> >  {
> >  struct device *dev = &cyapa->client->dev;
> > +char *envp[2] = {"ERROR=1", NULL};
> >  int ret;
> > -struct input_dev *input;
> >
> > -if (!cyapa->physical_size_x || !cyapa->physical_size_y)
> > -return -EINVAL;
> > +ret = cyapa_check_is_operational(cyapa);
> > +if (ret) {
> > +if (ret != -ETIMEDOUT && ret != -ENODEV &&
> > +((cyapa->gen == CYAPA_GEN3 &&
> > +cyapa->state >= CYAPA_STATE_BL_BUSY &&
> > +cyapa->state <= CYAPA_STATE_BL_ACTIVE) ||
> > +(cyapa->gen == CYAPA_GEN5 &&
> > +cyapa->state == CYAPA_STATE_GEN5_BL))) {
> > +dev_warn(dev, "device detected, but no operatinal.\n");
> > +dev_warn(dev, "device gen=%d, state=0x%02x\n",
> > +cyapa->gen, cyapa->state);
> > +dev_warn(dev, "munually fw image recover required.\n");
> > +return 1;
>
> Hmm, what userspace uses this kind of notification?

My idea is, when device waiting in bootloader for firmware image error, then
the driver should keep actived, so user/system can have the chance to update the firmware to recover it.
And you are correct, usersapce may don't know the return status of 1.
We could add an sysfs interface, such state, so usersapce can read the state (0: operational, 1 or non-0: bootloader).

>
> > +}
> >
> > -input = cyapa->input = devm_input_allocate_device(dev);
> > -if (!input) {
> > -dev_err(dev, "allocate memory for input device failed\n");
> > -return -ENOMEM;
> > +dev_err(dev, "no device detected, (%d)\n", ret);
> > +kobject_uevent_env(&dev->kobj, KOBJ_CHANGE, envp);
> > +return ret;
> >  }
> >
> > -input->name = CYAPA_NAME;
> > -input->phys = cyapa->phys;
> > -input->id.bustype = BUS_I2C;
> > -input->id.version = 1;
> > -input->id.product = 0;  /* means any product in eventcomm. */
> > -input->dev.parent = &cyapa->client->dev;
> > +if (!cyapa->input) {
> > +ret = cyapa_create_input_dev(cyapa);
> > +if (ret) {
> > +dev_err(dev, "create input_dev instance failed, (%d)\n",
> > +ret);
> > +return ret;
> > +}
> >
> > -input_set_drvdata(input, cyapa);
> > +/*
> > + * On some systems, a system crash / warm boot does not reset
> > + * the device's current power mode to FULL_ACTIVE.
> > + * If such an event happens during suspend, after the device
> > + * has been put in a low power mode, the device will still be
> > + * in low power mode on a subsequent boot, since there was
> > + * never a matching resume().
> > + * Handle this by always forcing full power here, when a
> > + * device is first detected to be in operational mode.
> > + */
> > +if (cyapa->ops->set_power_mode) {
> > +ret = cyapa->ops->set_power_mode(cyapa,
> > +PWR_MODE_FULL_ACTIVE, 0);
> > +if (ret)
> > +dev_warn(dev, "set active power failed, (%d)\n",
> > +ret);
> > +}
> > +}
> >
> > -__set_bit(EV_ABS, input->evbit);
> > +return 0;
> > +}
> >
> > -/* finger position */
> > -input_set_abs_params(input, ABS_MT_POSITION_X, 0, cyapa->max_abs_x, 0,
> > -     0);
> > -input_set_abs_params(input, ABS_MT_POSITION_Y, 0, cyapa->max_abs_y, 0,
> > -     0);
> > -input_set_abs_params(input, ABS_MT_PRESSURE, 0, 255, 0, 0);
> > +/*
> > + * Sysfs Interface.
> > + */
> >
> > -input_abs_set_res(input, ABS_MT_POSITION_X,
> > -  cyapa->max_abs_x / cyapa->physical_size_x);
> > -input_abs_set_res(input, ABS_MT_POSITION_Y,
> > -  cyapa->max_abs_y / cyapa->physical_size_y);
> > +/*
> > + * cyapa_sleep_time_to_pwr_cmd and cyapa_pwr_cmd_to_sleep_time
> > + *
> > + * These are helper functions that convert to and from integer idle
> > + * times and register settings to write to the PowerMode register.
> > + * The trackpad supports between 20ms to 1000ms scan intervals.
> > + * The time will be increased in increments of 10ms from 20ms to 100ms.
> > + * From 100ms to 1000ms, time will be increased in increments of 20ms.
> > + *
> > + * When Idle_Time < 100, the format to convert Idle_Time to Idle_Command is:
> > + *   Idle_Command = Idle Time / 10;
> > + * When Idle_Time >= 100, the format to convert Idle_Time to Idle_Command is:
> > + *   Idle_Command = Idle Time / 20 + 5;
> > + */
> > +u8 cyapa_sleep_time_to_pwr_cmd(u16 sleep_time)
> > +{
> > +sleep_time = clamp_val(sleep_time, 20, 1000);
> >
> > -if (cyapa->btn_capability & CAPABILITY_LEFT_BTN_MASK)
> > -__set_bit(BTN_LEFT, input->keybit);
> > -if (cyapa->btn_capability & CAPABILITY_MIDDLE_BTN_MASK)
> > -__set_bit(BTN_MIDDLE, input->keybit);
> > -if (cyapa->btn_capability & CAPABILITY_RIGHT_BTN_MASK)
> > -__set_bit(BTN_RIGHT, input->keybit);
> > +if (sleep_time < 100)
> > +return ((sleep_time / 10) << 2) & PWR_MODE_MASK;
> > +return ((sleep_time / 20 + 5) << 2) & PWR_MODE_MASK;
> > +}
>
> Maybe:
>
> encoded_time = sleep_time < 100 ?
> sleep_time / 10 : sleep_time / 20 + 5;
> return (encode_time << 2) & PWR_MODE_MASK;

Thanks, applied.

> >
> > -if (cyapa->btn_capability == CAPABILITY_LEFT_BTN_MASK)
> > -__set_bit(INPUT_PROP_BUTTONPAD, input->propbit);
> > +u16 cyapa_pwr_cmd_to_sleep_time(u8 pwr_mode)
> > +{
> > +u8 encoded_time = pwr_mode >> 2;
> >
> > -/* handle pointer emulation and unused slots in core */
> > -ret = input_mt_init_slots(input, CYAPA_MAX_MT_SLOTS,
> > -  INPUT_MT_POINTER | INPUT_MT_DROP_UNUSED);
> > -if (ret) {
> > -dev_err(dev, "allocate memory for MT slots failed, %d\n", ret);
> > -goto err_free_device;
> > -}
> > +return (encoded_time < 10) ? encoded_time * 10
> > +   : (encoded_time - 5) * 20;
> > +}
> >
> > -/* Register the device in input subsystem */
> > -ret = input_register_device(input);
> > -if (ret) {
> > -dev_err(dev, "input device register failed, %d\n", ret);
> > -goto err_free_device;
> > -}
> > -return 0;
> > +/*
> > + * Returns:
> > + *   0    Driver and device initialization successfully done.
> > + *   > 0  Driver initialized and device is detected, but not operational yet.
> > + *   < 0  Device is not detected, or driver initialization failed.
> > + */
> > +static int cyapa_initialize(struct cyapa *cyapa)
> > +{
> > +cyapa->state = CYAPA_STATE_NO_DEVICE;
> > +cyapa->gen = CYAPA_GEN_UNKNOWN;
> > +mutex_init(&cyapa->state_sync_lock);
> >
> > -err_free_device:
> > -input_free_device(input);
> > -cyapa->input = NULL;
> > -return ret;
> > +/*
> > + * Set to hard code default, they will be updated with trackpad set
> > + * default values after probe and initialized.
> > + */
> > +cyapa->suspend_power_mode = PWR_MODE_SLEEP;
> > +cyapa->suspend_sleep_time =
> > +cyapa_pwr_cmd_to_sleep_time(cyapa->suspend_power_mode);
> > +
> > +return cyapa_detect(cyapa);
> >  }
> >
> >  static int cyapa_probe(struct i2c_client *client,
> > @@ -830,6 +443,7 @@ static int cyapa_probe(struct i2c_client *client,
> >  u8 adapter_func;
> >  struct cyapa *cyapa;
> >  struct device *dev = &client->dev;
> > +union i2c_smbus_data dummy;
> >
> >  adapter_func = cyapa_check_adapter_functionality(client);
> >  if (adapter_func == CYAPA_ADAPTER_FUNC_NONE) {
> > @@ -837,48 +451,39 @@ static int cyapa_probe(struct i2c_client *client,
> >  return -EIO;
> >  }
> >
> > +/* Make sure there is something at this address */
> > +if (i2c_smbus_xfer(client->adapter, client->addr, 0,
> > +I2C_SMBUS_READ, 0, I2C_SMBUS_BYTE, &dummy) < 0)
> > +return -ENODEV;
> > +
> >  cyapa = devm_kzalloc(dev, sizeof(struct cyapa), GFP_KERNEL);
> >  if (!cyapa)
> >  return -ENOMEM;
> >
> > -cyapa->gen = CYAPA_GEN3;
> > -cyapa->client = client;
> > -i2c_set_clientdata(client, cyapa);
> > -sprintf(cyapa->phys, "i2c-%d-%04x/input0", client->adapter->nr,
> > -client->addr);
> > -
> >  /* i2c isn't supported, use smbus */
> >  if (adapter_func == CYAPA_ADAPTER_FUNC_SMBUS)
> >  cyapa->smbus = true;
> > -cyapa->state = CYAPA_STATE_NO_DEVICE;
> > -ret = cyapa_check_is_operational(cyapa);
> > -if (ret) {
> > -dev_err(dev, "device not operational, %d\n", ret);
> > -return ret;
> > -}
> >
> > -ret = cyapa_create_input_dev(cyapa);
> > -if (ret) {
> > -dev_err(dev, "create input_dev instance failed, %d\n", ret);
> > -return ret;
> > -}
> > +cyapa->client = client;
> > +i2c_set_clientdata(client, cyapa);
> > +sprintf(cyapa->phys, "i2c-%d-%04x/input0", client->adapter->nr,
> > +client->addr);
> >
> > -ret = cyapa_set_power_mode(cyapa, PWR_MODE_FULL_ACTIVE);
> > -if (ret) {
> > -dev_err(dev, "set active power failed, %d\n", ret);
> > +ret = cyapa_initialize(cyapa);
> > +if (ret < 0) {
> > +dev_err(dev, "failed to detect and initialize tp device.\n");
> >  return ret;
> >  }
> >
> > -cyapa->irq = client->irq;
> >  ret = devm_request_threaded_irq(dev,
> > -cyapa->irq,
> > +client->irq,
> >  NULL,
> >  cyapa_irq,
> >  IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
> >  "cyapa",
> >  cyapa);
> >  if (ret) {
> > -dev_err(dev, "IRQ request failed: %d\n, ", ret);
> > +dev_err(dev, "failed to request threaded irq, (%d)\n, ", ret);
> >  return ret;
> >  }
> >
> > @@ -889,8 +494,10 @@ static int cyapa_remove(struct i2c_client *client)
> >  {
> >  struct cyapa *cyapa = i2c_get_clientdata(client);
> >
> > -disable_irq(cyapa->irq);
> > -cyapa_set_power_mode(cyapa, PWR_MODE_OFF);
> > +disable_irq(cyapa->client->irq);
> > +
> > +if (cyapa->ops->set_power_mode)
> > +cyapa->ops->set_power_mode(cyapa, PWR_MODE_OFF, 0);
> >
> >  return 0;
> >  }
> > @@ -902,20 +509,38 @@ static int cyapa_suspend(struct device *dev)
> >  u8 power_mode;
> >  struct cyapa *cyapa = dev_get_drvdata(dev);
> >
> > -disable_irq(cyapa->irq);
> > +ret = mutex_lock_interruptible(&cyapa->state_sync_lock);
> > +if (ret) {
> > +dev_err(dev, "suspend interrupted by signal, (%d)\n", ret);
> > +return ret;
> > +}
>
> For patterns:
>
> var = action();
> if (var) {
> .. error handling ...
> return var;
> }
>
> return 0;
>
> i.e. when value of 'var' ony used in error handling path I strongly
> prefer to call 'var' error. If you do return value of 'var' in both
> error and success paths then 'ret' or 'retval' are preferred names.

Thanks for the suggestion, I will update it to keep them consistence.

>
> > +
> > +/*
> > + * Disable IRQ to avoid the command response interrupt cause system
> > + * suspending process interrupted and failed.
> > + * Because the gen5 devices will always assert interrupt to host after
> > + * executed the set power mode command.
> > + */
> > +disable_irq(cyapa->client->irq);
> >
> >  /*
> >   * Set trackpad device to idle mode if wakeup is allowed,
> >   * otherwise turn off.
> >   */
> > -power_mode = device_may_wakeup(dev) ? PWR_MODE_IDLE
> > +power_mode = device_may_wakeup(dev) ? cyapa->suspend_power_mode
> >      : PWR_MODE_OFF;
> > -ret = cyapa_set_power_mode(cyapa, power_mode);
> > -if (ret < 0)
> > -dev_err(dev, "set power mode failed, %d\n", ret);
> > +if (cyapa->input && cyapa->ops->set_power_mode) {
>
> The gating on cyapa->input is not obvious. Should we check the device
> status (or introduce one to indicate that the device in fully
> initialized state). Also, instead of checking presence of various
> methods I'd rather have providers supply stubs if they do not implement
> something.

I think it can be solved as your suggestion before for cyapa_detect() only return operational or not.
and add other variable for detail of the device state.

>
> > +ret = cyapa->ops->set_power_mode(cyapa, power_mode,
> > +cyapa->suspend_sleep_time);
> > +if (ret < 0)
> > +dev_err(dev, "suspend set power mode failed, %d\n",
> > +ret);
> > +}
> >
> >  if (device_may_wakeup(dev))
> > -cyapa->irq_wake = (enable_irq_wake(cyapa->irq) == 0);
> > +cyapa->irq_wake = (enable_irq_wake(cyapa->client->irq) == 0);
> > +
> > +mutex_unlock(&cyapa->state_sync_lock);
> >  return 0;
> >  }
> >
> > @@ -924,19 +549,29 @@ static int cyapa_resume(struct device *dev)
> >  int ret;
> >  struct cyapa *cyapa = dev_get_drvdata(dev);
> >
> > -if (device_may_wakeup(dev) && cyapa->irq_wake)
> > -disable_irq_wake(cyapa->irq);
> > -
> > -ret = cyapa_set_power_mode(cyapa, PWR_MODE_FULL_ACTIVE);
> > +ret = mutex_lock_interruptible(&cyapa->state_sync_lock);
> >  if (ret)
> > -dev_warn(dev, "resume active power failed, %d\n", ret);
> > +dev_err(dev, "resume interrupted by signal, (%d)\n", ret);
> >
> > -enable_irq(cyapa->irq);
> > +if (cyapa->irq_wake) {
> > +disable_irq_wake(cyapa->client->irq);
> > +cyapa->irq_wake = false;
> > +}
> > +
> > +/* Reset to active power state after re-detected. */
> > +cyapa_detect(cyapa);
> > +
> > +enable_irq(cyapa->client->irq);
> > +
> > +if (!ret)
> > +mutex_unlock(&cyapa->state_sync_lock);
> >  return 0;
> >  }
> >  #endif /* CONFIG_PM_SLEEP */
> >
> > -static SIMPLE_DEV_PM_OPS(cyapa_pm_ops, cyapa_suspend, cyapa_resume);
> > +static const struct dev_pm_ops cyapa_pm_ops = {
> > +SET_SYSTEM_SLEEP_PM_OPS(cyapa_suspend, cyapa_resume)
> > +};
> >
> >  static const struct i2c_device_id cyapa_id_table[] = {
> >  { "cyapa", 0 },
> > diff --git a/drivers/input/mouse/cyapa.h b/drivers/input/mouse/cyapa.h
> > new file mode 100644
> > index 0000000..ee97d7c
> > --- /dev/null
> > +++ b/drivers/input/mouse/cyapa.h
> > @@ -0,0 +1,321 @@
> > +/*
> > + * Cypress APA trackpad with I2C interface
> > + *
> > + * Author: Dudley Du <dudl@cypress.com>
> > + *
> > + * Copyright (C) 2014 Cypress Semiconductor, Inc.
> > + *
> > + * This file is subject to the terms and conditions of the GNU General Public
> > + * License.  See the file COPYING in the main directory of this archive for
> > + * more details.
> > + */
> > +
> > +#ifndef _CYAPA_H
> > +#define _CYAPA_H
> > +
> > +#include <linux/async.h>
> > +#include <linux/firmware.h>
> > +#include <linux/regulator/consumer.h>
> > +#include <linux/regulator/driver.h>
> > +
> > +/* APA trackpad firmware generation number. */
> > +#define CYAPA_GEN_UNKNOWN   0x00   /* unknown protocol. */
> > +#define CYAPA_GEN3   0x03   /* support MT-protocol B with tracking ID. */
> > +#define CYAPA_GEN5   0x05   /* support TrueTouch GEN5 trackpad device. */
> > +
> > +#define CYAPA_NAME   "Cypress APA Trackpad (cyapa)"
> > +
> > +/*
> > + * Macros for SMBus communication
> > + */
> > +#define SMBUS_READ   0x01
> > +#define SMBUS_WRITE 0x00
> > +#define SMBUS_ENCODE_IDX(cmd, idx) ((cmd) | (((idx) & 0x03) << 1))
> > +#define SMBUS_ENCODE_RW(cmd, rw) ((cmd) | ((rw) & 0x01))
> > +#define SMBUS_BYTE_BLOCK_CMD_MASK 0x80
> > +#define SMBUS_GROUP_BLOCK_CMD_MASK 0x40
> > +
> > +/* Commands for read/write registers of Cypress trackpad */
> > +#define CYAPA_CMD_SOFT_RESET       0x00
> > +#define CYAPA_CMD_POWER_MODE       0x01
> > +#define CYAPA_CMD_DEV_STATUS       0x02
> > +#define CYAPA_CMD_GROUP_DATA       0x03
> > +#define CYAPA_CMD_GROUP_CMD        0x04
> > +#define CYAPA_CMD_GROUP_QUERY      0x05
> > +#define CYAPA_CMD_BL_STATUS        0x06
> > +#define CYAPA_CMD_BL_HEAD          0x07
> > +#define CYAPA_CMD_BL_CMD           0x08
> > +#define CYAPA_CMD_BL_DATA          0x09
> > +#define CYAPA_CMD_BL_ALL           0x0a
> > +#define CYAPA_CMD_BLK_PRODUCT_ID   0x0b
> > +#define CYAPA_CMD_BLK_HEAD         0x0c
> > +#define CYAPA_CMD_MAX_BASELINE     0x0d
> > +#define CYAPA_CMD_MIN_BASELINE     0x0e
> > +
> > +#define BL_HEAD_OFFSET 0x00
> > +#define BL_DATA_OFFSET 0x10
> > +
> > +#define BL_STATUS_SIZE  3  /* Length of gen3 bootloader status registers */
> > +#define CYAPA_REG_MAP_SIZE  256
> > +
> > +/*
> > + * Gen3 Operational Device Status Register
> > + *
> > + * bit 7: Valid interrupt source
> > + * bit 6 - 4: Reserved
> > + * bit 3 - 2: Power status
> > + * bit 1 - 0: Device status
> > + */
> > +#define REG_OP_STATUS     0x00
> > +#define OP_STATUS_SRC     0x80
> > +#define OP_STATUS_POWER   0x0c
> > +#define OP_STATUS_DEV     0x03
> > +#define OP_STATUS_MASK (OP_STATUS_SRC | OP_STATUS_POWER |
> OP_STATUS_DEV)
> > +
> > +/*
> > + * Operational Finger Count/Button Flags Register
> > + *
> > + * bit 7 - 4: Number of touched finger
> > + * bit 3: Valid data
> > + * bit 2: Middle Physical Button
> > + * bit 1: Right Physical Button
> > + * bit 0: Left physical Button
> > + */
> > +#define REG_OP_DATA1       0x01
> > +#define OP_DATA_VALID      0x08
> > +#define OP_DATA_MIDDLE_BTN 0x04
> > +#define OP_DATA_RIGHT_BTN  0x02
> > +#define OP_DATA_LEFT_BTN   0x01
> > +#define OP_DATA_BTN_MASK (OP_DATA_MIDDLE_BTN | OP_DATA_RIGHT_BTN
> | \
> > +  OP_DATA_LEFT_BTN)
> > +
> > +/*
> > + * Write-only command file register used to issue commands and
> > + * parameters to the bootloader.
> > + * The default value read from it is always 0x00.
> > + */
> > +#define REG_BL_FILE0x00
> > +#define BL_FILE0x00
> > +
> > +/*
> > + * Bootloader Status Register
> > + *
> > + * bit 7: Busy
> > + * bit 6 - 5: Reserved
> > + * bit 4: Bootloader running
> > + * bit 3 - 2: Reserved
> > + * bit 1: Watchdog Reset
> > + * bit 0: Checksum valid
> > + */
> > +#define REG_BL_STATUS        0x01
> > +#define BL_STATUS_REV_6_5    0x60
> > +#define BL_STATUS_BUSY       0x80
> > +#define BL_STATUS_RUNNING    0x10
> > +#define BL_STATUS_REV_3_2    0x0c
> > +#define BL_STATUS_WATCHDOG   0x02
> > +#define BL_STATUS_CSUM_VALID 0x01
> > +#define BL_STATUS_REV_MASK (BL_STATUS_WATCHDOG | BL_STATUS_REV_3_2
> | \
> > +    BL_STATUS_REV_6_5)
> > +
> > +/*
> > + * Bootloader Error Register
> > + *
> > + * bit 7: Invalid
> > + * bit 6: Invalid security key
> > + * bit 5: Bootloading
> > + * bit 4: Command checksum
> > + * bit 3: Flash protection error
> > + * bit 2: Flash checksum error
> > + * bit 1 - 0: Reserved
> > + */
> > +#define REG_BL_ERROR         0x02
> > +#define BL_ERROR_INVALID     0x80
> > +#define BL_ERROR_INVALID_KEY 0x40
> > +#define BL_ERROR_BOOTLOADING 0x20
> > +#define BL_ERROR_CMD_CSUM    0x10
> > +#define BL_ERROR_FLASH_PROT  0x08
> > +#define BL_ERROR_FLASH_CSUM  0x04
> > +#define BL_ERROR_RESERVED    0x03
> > +#define BL_ERROR_NO_ERR_IDLE    0x00
> > +#define BL_ERROR_NO_ERR_ACTIVE  (BL_ERROR_BOOTLOADING)
> > +
> > +#define CAPABILITY_BTN_SHIFT            3
> > +#define CAPABILITY_LEFT_BTN_MASK(0x01 << 3)
> > +#define CAPABILITY_RIGHT_BTN_MASK(0x01 << 4)
> > +#define CAPABILITY_MIDDLE_BTN_MASK(0x01 << 5)
> > +#define CAPABILITY_BTN_MASK  (CAPABILITY_LEFT_BTN_MASK | \
> > +      CAPABILITY_RIGHT_BTN_MASK | \
> > +      CAPABILITY_MIDDLE_BTN_MASK)
> > +
> > +#define PWR_MODE_MASK   0xfc
> > +#define PWR_MODE_FULL_ACTIVE (0x3f << 2)
> > +#define PWR_MODE_IDLE        (0x03 << 2) /* Default rt suspend scanrate:
> 30ms */
> > +#define PWR_MODE_SLEEP       (0x05 << 2) /* Default suspend scanrate:
> 50ms */
> > +#define PWR_MODE_BTN_ONLY    (0x01 << 2)
> > +#define PWR_MODE_OFF         (0x00 << 2)
> > +
> > +#define PWR_STATUS_MASK      0x0c
> > +#define PWR_STATUS_ACTIVE    (0x03 << 2)
> > +#define PWR_STATUS_IDLE      (0x02 << 2)
> > +#define PWR_STATUS_BTN_ONLY  (0x01 << 2)
> > +#define PWR_STATUS_OFF       (0x00 << 2)
> > +
> > +#define AUTOSUSPEND_DELAY   2000 /* unit : ms */
> > +
> > +#define UNINIT_SLEEP_TIME 0xFFFF
> > +#define UNINIT_PWR_MODE   0xFF
> > +
> > +#define BTN_ONLY_MODE_NAME   "buttononly"
> > +#define OFF_MODE_NAME        "off"
> > +
> > +/* The touch.id is used as the MT slot id, thus max MT slot is 15 */
> > +#define CYAPA_MAX_MT_SLOTS  15
> > +
> > +struct cyapa;
> > +
> > +typedef bool (*cb_sort)(struct cyapa *, u8 *, int);
> > +
> > +struct cyapa_dev_ops {
> > +int (*check_fw)(struct cyapa *, const struct firmware *);
> > +int (*bl_enter)(struct cyapa *);
> > +int (*bl_activate)(struct cyapa *);
> > +int (*bl_initiate)(struct cyapa *, const struct firmware *);
> > +int (*update_fw)(struct cyapa *, const struct firmware *);
> > +int (*bl_verify_app_integrity)(struct cyapa *);
> > +int (*bl_deactivate)(struct cyapa *);
> > +
> > +ssize_t (*show_baseline)(struct device *,
> > +struct device_attribute *, char *);
> > +ssize_t (*calibrate_store)(struct device *,
> > +struct device_attribute *, const char *, size_t);
> > +
> > +int (*initialize)(struct cyapa *cyapa);
> > +
> > +int (*state_parse)(struct cyapa *cyapa, u8 *reg_status, int len);
> > +int (*operational_check)(struct cyapa *cyapa);
> > +
> > +int (*irq_handler)(struct cyapa *);
> > +bool (*irq_cmd_handler)(struct cyapa *);
> > +int (*sort_empty_output_data)(struct cyapa *,
> > +u8 *, int *, cb_sort);
> > +
> > +int (*set_power_mode)(struct cyapa *, u8, u16);
> > +};
> > +
> > +struct cyapa_gen5_cmd_states {
> > +struct mutex cmd_lock;
> > +struct completion cmd_ready;
> > +atomic_t cmd_issued;
> > +u8 in_progress_cmd;
> > +bool is_irq_mode;
> > +
> > +cb_sort resp_sort_func;
> > +u8 *resp_data;
> > +int *resp_len;
> > +
> > +u8 irq_cmd_buf[CYAPA_REG_MAP_SIZE];
> > +u8 empty_buf[CYAPA_REG_MAP_SIZE];
> > +};
> > +
> > +union cyapa_cmd_states {
> > +struct cyapa_gen5_cmd_states gen5;
> > +};
> > +
> > +enum cyapa_state {
> > +CYAPA_STATE_NO_DEVICE,
> > +CYAPA_STATE_BL_BUSY,
> > +CYAPA_STATE_BL_IDLE,
> > +CYAPA_STATE_BL_ACTIVE,
> > +CYAPA_STATE_OP,
> > +CYAPA_STATE_GEN5_BL,
> > +CYAPA_STATE_GEN5_APP,
> > +};
> > +
> > +struct cyapa_tsg_bin_image_head {
> > +u8 head_size;  /* Unit: bytes, including itself. */
> > +u8 ttda_driver_major_version;  /* Reserved as 0. */
> > +u8 ttda_driver_minor_version;  /* Reserved as 0. */
> > +u8 fw_major_version;
> > +u8 fw_minor_version;
> > +u8 fw_revision_control_number[8];
> > +} __packed;
> > +
> > +/* The main device structure */
> > +struct cyapa {
> > +enum cyapa_state state;
> > +u8 status[BL_STATUS_SIZE];
> > +
> > +struct i2c_client *client;
> > +struct input_dev *input;
> > +char phys[32];/* Device physical location */
> > +bool irq_wake;  /* Irq wake is enabled */
> > +bool smbus;
> > +
> > +/* power mode settings */
> > +u8 suspend_power_mode;
> > +u16 suspend_sleep_time;
> > +#ifdef CONFIG_PM_RUNTIME
> > +u8 runtime_suspend_power_mode;
> > +u16 runtime_suspend_sleep_time;
> > +#endif /* CONFIG_PM_RUNTIME */
>
> This I think should be introduce later, with runtime PM changes.

Thanks.

>
> > +u8 dev_pwr_mode;
> > +u16 dev_sleep_time;
> > +
> > +/* Read from query data region. */
> > +char product_id[16];
> > +u8 fw_maj_ver;  /* Firmware major version. */
> > +u8 fw_min_ver;  /* Firmware minor version. */
> > +u8 btn_capability;
> > +u8 gen;
> > +int max_abs_x;
> > +int max_abs_y;
> > +int physical_size_x;
> > +int physical_size_y;
> > +
> > +/* Used in ttsp and truetouch based trackpad devices. */
> > +u8 x_origin;  /* X Axis Origin: 0 = left side; 1 = rigth side. */
> > +u8 y_origin;  /* Y Axis Origin: 0 = top; 1 = bottom. */
> > +int electrodes_x;  /* Number of electrodes on the X Axis*/
> > +int electrodes_y;  /* Number of electrodes on the Y Axis*/
> > +int electrodes_rx;  /* Number of Rx electrodes */
> > +int max_z;
> > +
> > +/*
> > + * Used to synchronize the access or update the device state.
> > + * And since update firmware and read firmware image process will take
> > + * quite long time, maybe more than 10 seconds, so use mutex_lock
> > + * to sync and wait other interface and detecting are done or ready.
> > + */
> > +struct mutex state_sync_lock;
> > +
> > +const struct cyapa_dev_ops *ops;
> > +
> > +union cyapa_cmd_states cmd_states;
> > +};
> > +
> > +
> > +ssize_t cyapa_i2c_reg_read_block(struct cyapa *cyapa, u8 reg, size_t len,
> > +u8 *values);
> > +ssize_t cyapa_i2c_reg_write_block(struct cyapa *cyapa, u8 reg,
> > +size_t len, const u8 *values);
> > +ssize_t cyapa_smbus_read_block(struct cyapa *cyapa, u8 cmd, size_t len,
> > +u8 *values);
> > +
> > +s32 cyapa_read_byte(struct cyapa *cyapa, u8 cmd_idx);
> > +s32 cyapa_write_byte(struct cyapa *cyapa, u8 cmd_idx, u8 value);
>
> Do we still use these 2 fucntions?

You are correct, Thanks.
It has been moved to and only used in cyapa_gen3.c.

>
> > +ssize_t cyapa_read_block(struct cyapa *cyapa, u8 cmd_idx, u8 *values);
> > +
> > +ssize_t cyapa_i2c_read(struct cyapa *cyapa, u8 reg, size_t len, u8 *values);
> > +ssize_t cyapa_i2c_write(struct cyapa *cyapa, u8 reg,
> > +size_t len, const void *values);
> > +
> > +int cyapa_poll_state(struct cyapa *cyapa, unsigned int timeout);
> > +int cyapa_detect(struct cyapa *cyapa);
> > +
> > +u8 cyapa_sleep_time_to_pwr_cmd(u16 sleep_time);
> > +u16 cyapa_pwr_cmd_to_sleep_time(u8 pwr_mode);
> > +
> > +
> > +extern const char unique_str[];
> > +
> > +#endif
> > --
> > 1.9.1
> >
>
> Thanks.
>
> --
> Dmitry

This message and any attachments may contain Cypress (or its subsidiaries) confidential information. If it has been received in error, please advise the sender and immediately delete this message.

^ permalink raw reply

* Re: PATCH change for HID_BATTERY_STRENGTH kconfig
From: Daniel Nicoletti @ 2014-11-10 10:56 UTC (permalink / raw)
  To: Jiri Kosina; +Cc: linux-input
In-Reply-To: <alpine.LNX.2.00.1407291339040.16390@pobox.suse.cz>

Em Ter, 2014-07-29 às 13:39 +0200, Jiri Kosina escreveu:
> On Mon, 23 Jun 2014, Daniel Nicoletti wrote:
> 
> > 2013-05-23 19:16 GMT-03:00 Jiri Kosina <jkosina@suse.cz>:
> > > On Mon, 13 May 2013, Daniel Nicoletti wrote:
> > >
> > >> Hi,
> > >> I'd like to propose this patch while removes the need for
> > >> hid to be compiled build-in, as this is the same behavior
> > >> that WiiMote and Wacom have.
> > >> Is this ok?
> > >
> > > Makes sense to me. Could you please resend with proper changelog and
> > > Signed-off-by: line?
> > >
> > > Thanks.
> > 
> > Sorry it took more than a year for me to do this,
> > so I called git send-email, and so far the CC and
> > linux-input didn't get it, tho it said result OK.
> > git send-email --to "Jiri Kosina <jkosina@suse.cz>" --cc
> > "linux-input@vger.kernel.org"
> > 0001-HID-Allows-for-HID_BATTERY_STRENGTH-config-be-enable.patch
> > 
> > I'm pasting it here hoping gmail doesn't screw
> > it, if you prefer that I send it using the above
> > command mind you telling what I did wrong?
> > 
> > Thanks.
> > 
> > >From df740fd81dffbb74e13c622392fe9a945006fd3c Mon Sep 17 00:00:00 2001
> > From: Daniel Nicoletti <dantti12@gmail.com>
> > Date: Mon, 23 Jun 2014 10:31:47 -0300
> > Subject: [PATCH] HID: Allows for HID_BATTERY_STRENGTH config be enabled
> >  without the need for HID module to be built-in.
> > 
> 
> It'd be nice to insert a few sentences of changelog here.
> 
> Thanks.
> 
> > Signed-off-by: Daniel Nicoletti <dantti12@gmail.com>
> > ---
> >  drivers/hid/Kconfig | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig
> > index fb52f3f..d6d85ad 100644
> > --- a/drivers/hid/Kconfig
> > +++ b/drivers/hid/Kconfig
> > @@ -27,7 +27,8 @@ if HID
> > 
> >  config HID_BATTERY_STRENGTH
> >         bool "Battery level reporting for HID devices"
> > -       depends on HID && POWER_SUPPLY && HID = POWER_SUPPLY
> > +       depends on HID
> > +       select POWER_SUPPLY
> >         default n
> >         ---help---
> >         This option adds support of reporting battery strength (for HID devices
> > -- 
> > 2.0.0
> > 
> 
> -- 
> Jiri Kosina
> SUSE Labs

Sorry for yet another delay here is the patch with
a better changelog (I hope so)...


From 21608873917dcec012c7f9f1b84dd44774069de2 Mon Sep 17 00:00:00 2001
From: Daniel Nicoletti <dantti12@gmail.com>
Date: Mon, 23 Jun 2014 10:31:47 -0300
Subject: [PATCH] HID: Allow HID_BATTERY_STRENGTH to be enabled

Allows for HID_BATTERY_STRENGTH config be enabled
without the need for HID module to be built-in,
prior to this HID and POWER_SUPPLY had to be
equal, and now we only select POWER_SUPPLY and
depend on the HID module.

Signed-off-by: Daniel Nicoletti <dantti12@gmail.com>
---
 drivers/hid/Kconfig | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig
index f42df4d..602ac07 100644
--- a/drivers/hid/Kconfig
+++ b/drivers/hid/Kconfig
@@ -27,7 +27,8 @@ if HID
 
 config HID_BATTERY_STRENGTH
        bool "Battery level reporting for HID devices"
-       depends on HID && POWER_SUPPLY && HID = POWER_SUPPLY
+       depends on HID
+       select POWER_SUPPLY
        default n
        ---help---
        This option adds support of reporting battery strength (for HID
devices
-- 
2.1.0



--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related

* Re: [PATCH 1/4] input: touchscreen: ti_am335x_tsc Interchange touchscreen and ADC steps
From: Vignesh R @ 2014-11-10 10:46 UTC (permalink / raw)
  To: Richard Cochran
  Cc: Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala,
	Benoit Cousson, Tony Lindgren, Russell King, Jonathan Cameron,
	Dmitry Torokhov, devicetree, Lars-Peter Clausen, Samuel Ortiz,
	Jan Kardell, linux-iio, Sebastian Andrzej Siewior, linux-input,
	linux-kernel, Felipe Balbi, Paul Gortmaker, Peter Meerwald,
	Hartmut Knaack, linux-omap, Lee Jones
In-Reply-To: <20141107080033.GA6455@netboy>



On Friday 07 November 2014 01:30 PM, Richard Cochran wrote:
> On Fri, Nov 07, 2014 at 11:04:05AM +0530, Vignesh R wrote:
>>
>> Currently, there is too much noise in the TSC hardware that is being
>> removed by delta filtering.
> 
> The so called "filter" was only programmed because the fifo entries
> were being mixed up. Sebastian fixed that.
> 
>> I tested TSC unit by removing filtering
>> logic, the performance was not at all satisfactory. The cursor jumps
>> wayward and smooth circles cannot be drawn. Looks like delta filtering
>> cannot be removed as of now. May be I will try and address it in future.
> 
> The "filter" code is nonsensical. It picks the two values in seqeunce
> that are closest to one and another. How is that supposed to work?
> 
> Did you look at the "noise"? What kind of properties did you see?
> 
> A median filter makes more sense. Or sort, remove outliers, and
> average. But choosing the two closest in series is silly.

I was able to implement median filter as you described and achieve
reliable performance. I will append that to this series of patches in v3.

Regards
Vignesh

> 
> Thanks,
> Richard
> 

^ permalink raw reply

* Re: [PATCH 3/5] mfd: ti_am335x_tscadc: Remove unwanted reg_se_cache save
From: Vignesh R @ 2014-11-10 10:44 UTC (permalink / raw)
  To: Lee Jones
  Cc: Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala,
	Benoit Cousson, Tony Lindgren, Russell King, Jonathan Cameron,
	Hartmut Knaack, Dmitry Torokhov, Sebastian Andrzej Siewior,
	Lars-Peter Clausen, Peter Meerwald, Samuel Ortiz, Felipe Balbi,
	Brad Griffis, Sanjeev Sharma, Paul Gortmaker, Jan Kardell,
	devicetree, linux-kernel, linux-omap, linux-arm-kernel
In-Reply-To: <20141110092645.GE21424@x1>



On Monday 10 November 2014 02:56 PM, Lee Jones wrote:
> On Mon, 10 Nov 2014, Lee Jones wrote:
> 
>> On Fri, 07 Nov 2014, Vignesh R wrote:
>>
>>> In one shot mode, sequencer automatically disables all enabled steps at
>>> the end of each cycle. (both ADC steps and TSC steps) Hence these steps
>>> need not be saved in reg_se_cache for clearing these steps at a later
>>> stage.
>>> Also, when ADC wakes up Sequencer should not be busy executing any of the
>>> config steps except for the charge step. Previously charge step was 1 ADC
>>> clock cycle and hence it was ignored.
>>>
>>> Signed-off-by: Vignesh R <vigneshr@ti.com>
>>> ---
>>>  drivers/mfd/ti_am335x_tscadc.c       | 7 +++++--
>>>  include/linux/mfd/ti_am335x_tscadc.h | 1 +
>>>  2 files changed, 6 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/drivers/mfd/ti_am335x_tscadc.c b/drivers/mfd/ti_am335x_tscadc.c
>>> index d877e777cce6..94ef8992f46b 100644
>>> --- a/drivers/mfd/ti_am335x_tscadc.c
>>> +++ b/drivers/mfd/ti_am335x_tscadc.c
>>> @@ -86,8 +86,12 @@ static void am335x_tscadc_need_adc(struct ti_tscadc_dev *tsadc)
>>>  		spin_lock_irq(&tsadc->reg_lock);
>>>  		finish_wait(&tsadc->reg_se_wait, &wait);
>>>  
>>> +		/*
>>> +		 * Sequencer should either be idle or
>>> +		 * busy applying the charge step.
>>> +		 */
>>>  		reg = tscadc_readl(tsadc, REG_ADCFSM);
>>> -		WARN_ON(reg & SEQ_STATUS);
>>> +		WARN_ON(reg & SEQ_STATUS & (!CHARGE_STEP));
>>
>> This is almost certainly not correct.
>>
>> Please take another look at the logic.
>>
>> I'm _assuming_ you mean (reg & SEQ_STATUS && !CHARGE_STEP).
> 
> So I just saw that CHARGE_STEP is actually the new macro below.
> 
> So you're currently ANDing these together.
> 
> xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx  reg
> 00000000 00000000 00000000 00100000  #define SEQ_STATUS   BIT(5)
> 00000000 00000000 00000000 00010001  #define CHARGE_STEP  0x11
> 
> ... which will always equate to 0.
> 

Oops.. Sorry.. I meant ((reg & SEQ_STATUS) && !(reg & CHARGE_STEP)).
I will fix this.


>>>  		tsadc->adc_waiting = false;
>>>  	}
>>>  	tsadc->adc_in_use = true;
>>> @@ -96,7 +100,6 @@ static void am335x_tscadc_need_adc(struct ti_tscadc_dev *tsadc)
>>>  void am335x_tsc_se_set_once(struct ti_tscadc_dev *tsadc, u32 val)
>>>  {
>>>  	spin_lock_irq(&tsadc->reg_lock);
>>> -	tsadc->reg_se_cache |= val;
> 
> Didn't you add this line a little over 1 month ago?
> 
> Why the change of heart?
> 

Previously, TSC did not reliably re-enable its steps as the TSC irq
handler received false pen up events. Hence, in order to use TSC after
ADC operation, it was necessary to save and re-enable TSC steps
(basically, to keep TSC steps enabled always).
The change was more of a workaround to overcome limitation of TSC irq
handler. With this series of patches, TSC irq handler is very reliable
and the workaround is no longer required.

>>>  	am335x_tscadc_need_adc(tsadc);
>>>  
>>>  	tscadc_writel(tsadc, REG_SE, val);
>>> diff --git a/include/linux/mfd/ti_am335x_tscadc.h b/include/linux/mfd/ti_am335x_tscadc.h
>>> index c99be5dc0f5c..fcce182e4a35 100644
>>> --- a/include/linux/mfd/ti_am335x_tscadc.h
>>> +++ b/include/linux/mfd/ti_am335x_tscadc.h
>>> @@ -128,6 +128,7 @@
>>>  
>>>  /* Sequencer Status */
>>>  #define SEQ_STATUS BIT(5)
>>> +#define CHARGE_STEP		0x11
>>>  
>>>  #define ADC_CLK			3000000
>>>  #define TOTAL_STEPS		16
>>
> 

^ permalink raw reply

* Re: [PATCH 3/5] mfd: ti_am335x_tscadc: Remove unwanted reg_se_cache save
From: Lee Jones @ 2014-11-10  9:26 UTC (permalink / raw)
  To: Vignesh R
  Cc: Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala,
	Benoit Cousson, Tony Lindgren, Russell King, Jonathan Cameron,
	Hartmut Knaack, Dmitry Torokhov, Sebastian Andrzej Siewior,
	Lars-Peter Clausen, Peter Meerwald, Samuel Ortiz, Felipe Balbi,
	Brad Griffis, Sanjeev Sharma, Paul Gortmaker, Jan Kardell,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-omap-u79uwXL29TY76Z2rM5mHXA, linux-arm-kernel
In-Reply-To: <20141110091527.GD21424@x1>

On Mon, 10 Nov 2014, Lee Jones wrote:

> On Fri, 07 Nov 2014, Vignesh R wrote:
> 
> > In one shot mode, sequencer automatically disables all enabled steps at
> > the end of each cycle. (both ADC steps and TSC steps) Hence these steps
> > need not be saved in reg_se_cache for clearing these steps at a later
> > stage.
> > Also, when ADC wakes up Sequencer should not be busy executing any of the
> > config steps except for the charge step. Previously charge step was 1 ADC
> > clock cycle and hence it was ignored.
> > 
> > Signed-off-by: Vignesh R <vigneshr-l0cyMroinI0@public.gmane.org>
> > ---
> >  drivers/mfd/ti_am335x_tscadc.c       | 7 +++++--
> >  include/linux/mfd/ti_am335x_tscadc.h | 1 +
> >  2 files changed, 6 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/mfd/ti_am335x_tscadc.c b/drivers/mfd/ti_am335x_tscadc.c
> > index d877e777cce6..94ef8992f46b 100644
> > --- a/drivers/mfd/ti_am335x_tscadc.c
> > +++ b/drivers/mfd/ti_am335x_tscadc.c
> > @@ -86,8 +86,12 @@ static void am335x_tscadc_need_adc(struct ti_tscadc_dev *tsadc)
> >  		spin_lock_irq(&tsadc->reg_lock);
> >  		finish_wait(&tsadc->reg_se_wait, &wait);
> >  
> > +		/*
> > +		 * Sequencer should either be idle or
> > +		 * busy applying the charge step.
> > +		 */
> >  		reg = tscadc_readl(tsadc, REG_ADCFSM);
> > -		WARN_ON(reg & SEQ_STATUS);
> > +		WARN_ON(reg & SEQ_STATUS & (!CHARGE_STEP));
> 
> This is almost certainly not correct.
> 
> Please take another look at the logic.
> 
> I'm _assuming_ you mean (reg & SEQ_STATUS && !CHARGE_STEP).

So I just saw that CHARGE_STEP is actually the new macro below.

So you're currently ANDing these together.

xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx  reg
00000000 00000000 00000000 00100000  #define SEQ_STATUS   BIT(5)
00000000 00000000 00000000 00010001  #define CHARGE_STEP  0x11

... which will always equate to 0.

> >  		tsadc->adc_waiting = false;
> >  	}
> >  	tsadc->adc_in_use = true;
> > @@ -96,7 +100,6 @@ static void am335x_tscadc_need_adc(struct ti_tscadc_dev *tsadc)
> >  void am335x_tsc_se_set_once(struct ti_tscadc_dev *tsadc, u32 val)
> >  {
> >  	spin_lock_irq(&tsadc->reg_lock);
> > -	tsadc->reg_se_cache |= val;

Didn't you add this line a little over 1 month ago?

Why the change of heart?

> >  	am335x_tscadc_need_adc(tsadc);
> >  
> >  	tscadc_writel(tsadc, REG_SE, val);
> > diff --git a/include/linux/mfd/ti_am335x_tscadc.h b/include/linux/mfd/ti_am335x_tscadc.h
> > index c99be5dc0f5c..fcce182e4a35 100644
> > --- a/include/linux/mfd/ti_am335x_tscadc.h
> > +++ b/include/linux/mfd/ti_am335x_tscadc.h
> > @@ -128,6 +128,7 @@
> >  
> >  /* Sequencer Status */
> >  #define SEQ_STATUS BIT(5)
> > +#define CHARGE_STEP		0x11
> >  
> >  #define ADC_CLK			3000000
> >  #define TOTAL_STEPS		16
> 

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply

* Re: [PATCH v3 3/4] input: alps: For protocol V3, do not process data when last packet's bit7 is set
From: Pali Rohár @ 2014-11-10  9:18 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Hans de Goede, Yunkang Tang, Tommy Will, linux-input,
	linux-kernel
In-Reply-To: <20141109203459.GB37384@dtor-ws>

[-- Attachment #1: Type: Text/Plain, Size: 3246 bytes --]

On Sunday 09 November 2014 21:34:59 Dmitry Torokhov wrote:
> On Sun, Nov 09, 2014 at 12:22:51PM +0100, Pali Rohár wrote:
> > On Sunday 09 November 2014 08:50:39 Dmitry Torokhov wrote:
> > > Hi Pali,
> > > 
> > > On Sun, Nov 02, 2014 at 12:25:09AM +0100, Pali Rohár wrote:
> > > > Sometimes on Dell Latitude laptops psmouse/alps driver
> > > > receive invalid ALPS protocol V3 packets with bit7 set
> > > > in last byte. More often it can be reproduced on Dell
> > > > Latitude E6440 or E7440 with closed lid and pushing
> > > > cover above touchpad.
> > > > 
> > > > If bit7 in last packet byte is set then it is not valid
> > > > ALPS packet. I was told that ALPS devices never send
> > > > these packets. It is not know yet who send those
> > > > packets, it could be Dell EC, bug in BIOS and also bug
> > > > in touchpad firmware...
> > > > 
> > > > With this patch alps driver does not process those
> > > > invalid packets and drops it with PSMOUSE_FULL_PACKET
> > > > so psmouse driver does not enter to out of sync state.
> > > > 
> > > > This patch fix problem when psmouse driver still
> > > > resetting ALPS device when laptop lid is closed because
> > > > of receiving invalid packets in out of sync state.
> > > > 
> > > > Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
> > > > Tested-by: Pali Rohár <pali.rohar@gmail.com>
> > > > Cc: stable@vger.kernel.org
> > > > ---
> > > > 
> > > >  drivers/input/mouse/alps.c |   10 ++++++++++
> > > >  1 file changed, 10 insertions(+)
> > > > 
> > > > diff --git a/drivers/input/mouse/alps.c
> > > > b/drivers/input/mouse/alps.c index 7c47e97..e802d28
> > > > 100644 --- a/drivers/input/mouse/alps.c
> > > > +++ b/drivers/input/mouse/alps.c
> > > > @@ -1181,6 +1181,16 @@ static psmouse_ret_t
> > > > alps_process_byte(struct psmouse *psmouse)
> > > > 
> > > >  		return PSMOUSE_BAD_DATA;
> > > >  	
> > > >  	}
> > > > 
> > > > +	if (priv->proto_version == ALPS_PROTO_V3 &&
> > > > psmouse->pktcnt == psmouse->pktsize) { +		// For
> > > > protocol V3, do not process data when last packet's
> > > > bit7 is set +		if (psmouse->packet[psmouse->pktcnt - 
1]
> > > > & 0x80) { +			psmouse_dbg(psmouse, "v3 discard
> > > > packet[%i] =
> > 
> > %x\n",
> > 
> > > > +				    psmouse->pktcnt - 1,
> > > > +				    psmouse->packet[psmouse->pktcnt - 1]);
> > > > +			return PSMOUSE_FULL_PACKET;
> > > > +		}
> > > > +	}
> > > 
> > > I wanted to apply it, but I would like some more data.
> > > Could you please send me the dmesg with i8042.debug wit
> > > this patch in place?
> > > 
> > > Thanks!
> > 
> > See attachment. It contains debug log from both
> > i8042.debug=1 and psmouse.ko with applied all 4 patches.
> 
> Thank you Pali.
> 
> OK, so it looks like the problematic byte is the last one and
> we should be resynching right away. With your other patch
> increasing number of bad packets before issuing resync this
> special handling is no longer needed, right?
> 
> Thanks.

Problem is that in this special case driver is still out-of-sync 
and cause problems. E.g there is big dmesg flood and it is not 
good to have that when LID is closed for a long time.

-- 
Pali Rohár
pali.rohar@gmail.com

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply

* Re: [PATCH 3/5] mfd: ti_am335x_tscadc: Remove unwanted reg_se_cache save
From: Lee Jones @ 2014-11-10  9:15 UTC (permalink / raw)
  To: Vignesh R
  Cc: Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala,
	Benoit Cousson, Tony Lindgren, Russell King, Jonathan Cameron,
	Hartmut Knaack, Dmitry Torokhov, Sebastian Andrzej Siewior,
	Lars-Peter Clausen, Peter Meerwald, Samuel Ortiz, Felipe Balbi,
	Brad Griffis, Sanjeev Sharma, Paul Gortmaker, Jan Kardell,
	devicetree, linux-kernel, linux-omap, linux-arm-kernel
In-Reply-To: <1415339350-17679-4-git-send-email-vigneshr@ti.com>

On Fri, 07 Nov 2014, Vignesh R wrote:

> In one shot mode, sequencer automatically disables all enabled steps at
> the end of each cycle. (both ADC steps and TSC steps) Hence these steps
> need not be saved in reg_se_cache for clearing these steps at a later
> stage.
> Also, when ADC wakes up Sequencer should not be busy executing any of the
> config steps except for the charge step. Previously charge step was 1 ADC
> clock cycle and hence it was ignored.
> 
> Signed-off-by: Vignesh R <vigneshr@ti.com>
> ---
>  drivers/mfd/ti_am335x_tscadc.c       | 7 +++++--
>  include/linux/mfd/ti_am335x_tscadc.h | 1 +
>  2 files changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/mfd/ti_am335x_tscadc.c b/drivers/mfd/ti_am335x_tscadc.c
> index d877e777cce6..94ef8992f46b 100644
> --- a/drivers/mfd/ti_am335x_tscadc.c
> +++ b/drivers/mfd/ti_am335x_tscadc.c
> @@ -86,8 +86,12 @@ static void am335x_tscadc_need_adc(struct ti_tscadc_dev *tsadc)
>  		spin_lock_irq(&tsadc->reg_lock);
>  		finish_wait(&tsadc->reg_se_wait, &wait);
>  
> +		/*
> +		 * Sequencer should either be idle or
> +		 * busy applying the charge step.
> +		 */
>  		reg = tscadc_readl(tsadc, REG_ADCFSM);
> -		WARN_ON(reg & SEQ_STATUS);
> +		WARN_ON(reg & SEQ_STATUS & (!CHARGE_STEP));

This is almost certainly not correct.

Please take another look at the logic.

I'm _assuming_ you mean (reg & SEQ_STATUS && !CHARGE_STEP).

>  		tsadc->adc_waiting = false;
>  	}
>  	tsadc->adc_in_use = true;
> @@ -96,7 +100,6 @@ static void am335x_tscadc_need_adc(struct ti_tscadc_dev *tsadc)
>  void am335x_tsc_se_set_once(struct ti_tscadc_dev *tsadc, u32 val)
>  {
>  	spin_lock_irq(&tsadc->reg_lock);
> -	tsadc->reg_se_cache |= val;
>  	am335x_tscadc_need_adc(tsadc);
>  
>  	tscadc_writel(tsadc, REG_SE, val);
> diff --git a/include/linux/mfd/ti_am335x_tscadc.h b/include/linux/mfd/ti_am335x_tscadc.h
> index c99be5dc0f5c..fcce182e4a35 100644
> --- a/include/linux/mfd/ti_am335x_tscadc.h
> +++ b/include/linux/mfd/ti_am335x_tscadc.h
> @@ -128,6 +128,7 @@
>  
>  /* Sequencer Status */
>  #define SEQ_STATUS BIT(5)
> +#define CHARGE_STEP		0x11
>  
>  #define ADC_CLK			3000000
>  #define TOTAL_STEPS		16

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: tsc2005 touchscreen: implement disable attribute
From: Pali Rohár @ 2014-11-10  9:14 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Sebastian Reichel, Pavel Machek, kernel list, linux-arm-kernel,
	linux-omap, tony, khilman, aaro.koskinen, freemangordon, B38611,
	jg1.han, linux-input
In-Reply-To: <20141109200142.GA37384@dtor-ws>

[-- Attachment #1: Type: Text/Plain, Size: 1678 bytes --]

On Sunday 09 November 2014 21:01:42 Dmitry Torokhov wrote:
> On Sun, Nov 09, 2014 at 01:49:19PM +0100, Pali Rohár wrote:
> > On Sunday 09 November 2014 13:40:25 Sebastian Reichel wrote:
> > > Hi,
> > > 
> > > On Sun, Nov 09, 2014 at 12:56:37PM +0100, Pavel Machek 
wrote:
> > > > Implement disable attribute for tsc2005 touchscreen. It
> > > > is useful to avoid wakeups when phone is in the pocket.
> > > 
> > > I don't think this should be some driver specific sysfs
> > > node. Instead a generic method from the input subsystem
> > > should be used.
> > > 
> > > -- Sebastian
> > 
> > Yes. I would like to see generic method to turn off input
> > device (or just "mute" it if device does not support turn
> > off). Similar problem is also on laptops or other portable
> > devices. E.g when I close LID of my laptop I want to turn
> > off internal input devices (keyboard, touchpad, trackstick)
> > without need to unload evdev Xserver drivers (or killing
> > Xserver). Another use case is to turn off keyboard (also
> > from kernel tty on Ctrl+Alt+Fx) which cannot be unplugged
> > (internal laptop keyboard).
> > 
> > CCed Dmitry, what do you think about it?
> 
> Actually I'd like it to be not limited to input devices but
> rater try doing it at the device core level, if possible. I
> am sure there are IIO and other devices that could be
> forcibly turned off/put into low power mode under certain
> circumstances.
> 
> There were some talks about it with Rafael, but we never come
> with anything concrete.
> 
> Thanks.

Ok. What about adding sysfs node disable which accept value 0/1?

-- 
Pali Rohár
pali.rohar@gmail.com

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox