Input: wm9713 - support five wire panels
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
This commit is contained in:
		
					parent
					
						
							
								5de4cd431d
							
						
					
				
			
			
				commit
				
					
						43f83a8f99
					
				
			
		
					 2 changed files with 23 additions and 0 deletions
				
			
		| 
						 | 
					@ -84,6 +84,15 @@ static int delay = 4;
 | 
				
			||||||
module_param(delay, int, 0);
 | 
					module_param(delay, int, 0);
 | 
				
			||||||
MODULE_PARM_DESC(delay, "Set adc sample delay.");
 | 
					MODULE_PARM_DESC(delay, "Set adc sample delay.");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/*
 | 
				
			||||||
 | 
					 * Set five_wire = 1 to use a 5 wire touchscreen.
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * NOTE: Five wire mode does not allow for readback of pressure.
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					static int five_wire;
 | 
				
			||||||
 | 
					module_param(five_wire, int, 0);
 | 
				
			||||||
 | 
					MODULE_PARM_DESC(five_wire, "Set to '1' to use 5-wire touchscreen.");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 * Set adc mask function.
 | 
					 * Set adc mask function.
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
| 
						 | 
					@ -162,6 +171,19 @@ static void wm9713_phy_init(struct wm97xx *wm)
 | 
				
			||||||
			 64000 / rpu);
 | 
								 64000 / rpu);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/* Five wire panel? */
 | 
				
			||||||
 | 
						if (five_wire) {
 | 
				
			||||||
 | 
							dig3 |= WM9713_45W;
 | 
				
			||||||
 | 
							dev_info(wm->dev, "setting 5-wire touchscreen mode.");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							if (pil) {
 | 
				
			||||||
 | 
								dev_warn(wm->dev,
 | 
				
			||||||
 | 
									 "Pressure measurement not supported in 5 "
 | 
				
			||||||
 | 
									 "wire mode, disabling\n");
 | 
				
			||||||
 | 
								pil = 0;
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/* touchpanel pressure */
 | 
						/* touchpanel pressure */
 | 
				
			||||||
	if (pil == 2) {
 | 
						if (pil == 2) {
 | 
				
			||||||
		dig3 |= WM9712_PIL;
 | 
							dig3 |= WM9712_PIL;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -100,6 +100,7 @@
 | 
				
			||||||
#define WM9713_ADCSEL_Y		0x0004	/* Y measurement */
 | 
					#define WM9713_ADCSEL_Y		0x0004	/* Y measurement */
 | 
				
			||||||
#define WM9713_ADCSEL_PRES	0x0008	/* Pressure measurement */
 | 
					#define WM9713_ADCSEL_PRES	0x0008	/* Pressure measurement */
 | 
				
			||||||
#define WM9713_COO		0x0001	/* enable coordinate mode */
 | 
					#define WM9713_COO		0x0001	/* enable coordinate mode */
 | 
				
			||||||
 | 
					#define WM9713_45W		0x1000  /* set for 5 wire panel */
 | 
				
			||||||
#define WM9713_PDEN		0x0800	/* measure only when pen down */
 | 
					#define WM9713_PDEN		0x0800	/* measure only when pen down */
 | 
				
			||||||
#define WM9713_ADCSEL_MASK	0x00fe	/* ADC selection mask */
 | 
					#define WM9713_ADCSEL_MASK	0x00fe	/* ADC selection mask */
 | 
				
			||||||
#define WM9713_WAIT		0x0200	/* coordinate wait */
 | 
					#define WM9713_WAIT		0x0200	/* coordinate wait */
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue