2011-05-07 02:39:12 AD714x configuration issue
Chandrashekhar Lavania (INDIA)
Message: 100495
Hi,
I am using AD7147 Touch Cap in my UI board. I am using 2010R1-RC5 with my BF527 based board. I am trying to configure my AD714x module by adding entries in the platform file for it. But, I have some doubts.
1. In the file include/linux/input/ad714x.h :
struct ad714x_button_plat {
int keycode;
unsigned short l_mask;
unsigned short h_mask;
};
What does the l_mask and h_mask represent and how do I configure these values in my platform file for the buttons. There must be a rule which is followed to assign values to these masks.
I am following wiki.analog.com/resources/tools-software/linux-drivers/input-misc/ad714x .
But I was unable to find the explanation for these masks.
I am using an I2C based Touch Cap.
Regards,
Shekhar
QuoteReplyEditDelete
2011-05-09 02:15:16 Re: AD714x configuration issue
Sonic Zhang (CHINA)
Message: 100502
Please refer to code at drivers/input/misc/ad714x.c:239 . h_mask and l_mask maps CDCs' positive and negative status to a button index. h_mask masks position bits and l_mask masks negative bits.
QuoteReplyEditDelete
2011-05-09 05:30:57 Re: AD714x configuration issue
Chandrashekhar Lavania (INDIA)
Message: 100512
Hi,
Just wanted to clarify...
If I want to attach a button to say.......positive of stage 5. Then does it mean that the masks for that button are as follows..
h_mask = 0x20 ( binary is 0000 0000 0010 0000)
l_mask = 0
Regards,
Shekhar
QuoteReplyEditDelete
2011-05-09 05:37:58 Re: AD714x configuration issue
Michael Hennerich (GERMANY)
Message: 100513 > If I want to attach a button to say.......positive of stage 5. Then
> does it mean that the masks for that button are as follows..
>
> h_mask = 0x20 ( binary is 0000 0000 0010 0000)
>
> l_mask = 0
Exactly - that's the case.
You must also provide stage_cfg_reg and sys_cfg_reg.
Below you can find a platform config for a 8 stage (stages 0..7) wheel and 4 buttons (stages 8,10,11,12).
www.analog.com/static/imported-files/eval_kit_manuals/Blackfin_Lndscpe_LCD_EZ_Extender_Manual_Rev.1.0_Aug08.pdf
#if defined(CONFIG_INPUT_AD714X_I2C) || defined(CONFIG_INPUT_AD714X_I2C_MODULE)
#include <linux/input/ad714x.h>
static struct ad714x_button_plat ad7147_button_plat[] = {
{
.keycode = BTN_1,
.l_mask = 0,
.h_mask = 0x100,
},
{
.keycode = BTN_2,
.l_mask = 0,
.h_mask = 0x200,
},
{
.keycode = BTN_3,
.l_mask = 0,
.h_mask = 0x400,
},
{
.keycode = BTN_4,
.l_mask = 0x0,
.h_mask = 0x800,
},
};
static struct ad714x_wheel_plat ad7147_wheel_plat = {
.start_stage = 0,
.end_stage = 7,
.max_coord = 1024,
};
static struct ad714x_slider_plat ad7147_slider_plat = {
.start_stage = 0,
.end_stage = 7,
.max_coord = 128,
};
static struct ad714x_platform_data wheel_dev_platform_data = {
.wheel_num = 0,
.button_num = 4,
.slider_num = 1,
.slider = &ad7147_slider_plat,
.button = ad7147_button_plat,
.wheel = &ad7147_wheel_plat,
.stage_cfg_reg = {
{0xEFFF, 0x1FFF, 0x0000, 0x2626, 2920, 2920, 3650, 3650},
{0xFFFF, 0x1FFE, 0x0000, 0x2626, 2920, 2920, 3650, 3650},
{0xFFFF, 0x1FFB, 0x0000, 0x2626, 2920, 2920, 3650, 3650},
{0xFFFF, 0x1FEF, 0x0000, 0x2626, 2920, 2920, 3650, 3650},
{0xFFFF, 0x1FBF, 0x0000, 0x2626, 2920, 2920, 3650, 3650},
{0xFFFF, 0x1EFF, 0x0000, 0x2626, 2920, 2920, 3650, 3650},
{0xFEFF, 0x1FFF, 0x0000, 0x2626, 2920, 2920, 3650, 3650},
{0xFBFF, 0x1FFF, 0x0000, 0x2626, 2920, 2920, 3650, 3650},
{0xFFFE, 0x1FFF, 0x0000, 0x2626, 5664, 5664, 7080, 7080},
{0xFFFB, 0x1FFF, 0x0000, 0x2626, 5664, 5664, 7080, 7080},
{0xFFEF, 0x1FFF, 0x0000, 0x2626, 5664, 5664, 7080, 7080},
{0xFFBF, 0x1FFF, 0x0000, 0x2626, 5664, 5664, 7080, 7080},
},
.sys_cfg_reg = {0x00B2, 0x0, 0x3230, 0x0819, 0x0832, 0x0FFF, 0x0FFF, 0x0000}, }; #endif
QuoteReplyEditDelete
2011-05-17 06:30:40 Re: AD714x configuration issue
Chandrashekhar Lavania (INDIA)
Message: 100691
Hi,
Since the Touch Cap module I use is based on the Ez-Extender, I used the following configuration::
static struct ad714x_button_plat ad7147_button_plat[] = {
{
.keycode = BTN_BASE,
.l_mask = 0,
.h_mask = 0x100,
},
{
.keycode = BTN_BASE2,
.l_mask = 0,
.h_mask = 0x200,
},
{
.keycode = BTN_BASE3,
.l_mask = 0,
.h_mask = 0x400,
},
{
.keycode = BTN_BASE4,
.l_mask = 0x0,
.h_mask = 0x800,
},
};
static struct ad714x_wheel_plat ad7147_wheel_plat = {
.start_stage = 0,
.end_stage = 7,
.max_coord = 1024,
};
static struct ad714x_platform_data touch_dev_platform_data = {
.wheel_num = 1,
.button_num = 4,
.slider_num = 0,
.slider = &ad7147_slider_plat,
.button = ad7147_button_plat,
.wheel = &ad7147_wheel_plat,
.stage_cfg_reg = {
{0xFEFF, 0x1FFF, 0x0000, 0x2626, 2920, 2920, 3650, 3650}, // CIN4 to STAGE0
{0xFBFF, 0x1FFF, 0x0000, 0x2626, 2920, 2920, 3650, 3650}, // CIN5 to STAGE1
{0xEFFF, 0x1FFF, 0x0000, 0x2626, 2920, 2920, 3650, 3650}, // CIN6 to STAGE2
{0xFFFF, 0x1FFE, 0x0000, 0x2626, 2920, 2920, 3650, 3650}, // CIN7 to STAGE3
{0xFFFF, 0x1FFB, 0x0000, 0x2626, 2920, 2920, 3650, 3650}, // CIN8 to STAGE4
{0xFFFF, 0x1FEF, 0x0000, 0x2626, 2920, 2920, 3650, 3650}, // CIN9 to STAGE5
{0xFFFF, 0x1FBF, 0x0000, 0x2626, 2920, 2920, 3650, 3650}, // CIN10 to STAGE6
{0xFFFF, 0x1EFF, 0x0000, 0x2626, 2920, 2920, 3650, 3650}, // CIN11 to STAGE7
{0xFFFE, 0x1FFF, 0x0000, 0x2626, 5664, 5664, 7080, 7080}, // CIN0 to STAGE8
{0xFFFB, 0x1FFF, 0x0000, 0x2626, 5664, 5664, 7080, 7080}, // CIN1 to STAGE9
{0xFFEF, 0x1FFF, 0x0000, 0x2626, 5664, 5664, 7080, 7080}, // CIN2 to STAGE10
{0xFFBF, 0x1FFF, 0x0000, 0x2626, 5664, 5664, 7080, 7080}, // CIN3 to STAGE11
},
.sys_cfg_reg = {0x00B2, 0x0, 0x3230, 0x0819, 0x0832, 0x0FFF, 0x0FFF, 0x0000},
};
When I do this then the push buttons ( CIN0 to CIN3) work fine but the wheel doesen't even respond. I tested it using the event_test utility.
What might be the issue??
Regards,
Shekhar
PS: If I map the the 8 sensors as seperate buttons instead of a wheel, then they seem to be working fine..i.e I get an event when I touch one of these buttons
QuoteReplyEditDelete
2011-05-17 07:12:46 Re: AD714x configuration issue
Michael Hennerich (GERMANY)
Message: 100692 Please try this patchset.
https://patchwork.kernel.org/project/linux-input/list/
[v2,6/6] input: misc: AD714x: Fix endianness issues
[v2,5/6] input: misc: AD714x: Fix captouch wheel option algorithm
[v2,4/6] input: misc: AD714x: Add option to specify irqflags
[v2,3/6] input: misc: AD714x: Fix thresh and completion interrupt mask and unmask functions
[v2,2/6] input: misc: AD714x: Fix up input configuration
[v2,1/6] input: misc: AD714x: The interrupt status registers should be read in row.