diff mbox

[1/5] add missing blob structure field for tag id

Message ID 1517950905-5015-2-git-send-email-floe@butterbrot.org (mailing list archive)
State New, archived
Headers show

Commit Message

Florian Echtler Feb. 6, 2018, 9:01 p.m. UTC
The SUR40 can recognize specific printed patterns directly in hardware;
this information (i.e. the pattern id) is present but currently unused
in the blob structure.

Signed-off-by: Florian Echtler <floe@butterbrot.org>
---
 drivers/input/touchscreen/sur40.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Hans Verkuil Feb. 6, 2018, 9:22 p.m. UTC | #1
On 02/06/2018 10:01 PM, Florian Echtler wrote:
> The SUR40 can recognize specific printed patterns directly in hardware;
> this information (i.e. the pattern id) is present but currently unused
> in the blob structure.
> 
> Signed-off-by: Florian Echtler <floe@butterbrot.org>
> ---
>  drivers/input/touchscreen/sur40.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/input/touchscreen/sur40.c b/drivers/input/touchscreen/sur40.c
> index f16f835..8375b06 100644
> --- a/drivers/input/touchscreen/sur40.c
> +++ b/drivers/input/touchscreen/sur40.c
> @@ -81,7 +81,10 @@ struct sur40_blob {
>  
>  	__le32 area;       /* size in pixels/pressure (?) */
>  
> -	u8 padding[32];
> +	u8 padding[24];
> +
> +	__le32 tag_id;     /* valid when type == 0x04 (SUR40_TAG) */
> +	__le32 unknown;
>  
>  } __packed;
>  
> 

Usually new fields are added before the padding, not after.

Unless there is a good reason for this I'd change this.

Regards,

	Hans
--
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
Florian Echtler Feb. 7, 2018, 8:24 a.m. UTC | #2
On 06.02.2018 22:22, Hans Verkuil wrote:
> On 02/06/2018 10:01 PM, Florian Echtler wrote:
>> The SUR40 can recognize specific printed patterns directly in hardware;
>> this information (i.e. the pattern id) is present but currently unused
>> in the blob structure.
>>
>>  
>>  	__le32 area;       /* size in pixels/pressure (?) */
>>  
>> -	u8 padding[32];
>> +	u8 padding[24];
>> +
>> +	__le32 tag_id;     /* valid when type == 0x04 (SUR40_TAG) */
>> +	__le32 unknown;
>>  
>>  } __packed;
>>  
> Usually new fields are added before the padding, not after.
> 
> Unless there is a good reason for this I'd change this.

This is how the hardware sends it, so there's little choice in how to arrange
the fields...

Best regards, Florian
diff mbox

Patch

diff --git a/drivers/input/touchscreen/sur40.c b/drivers/input/touchscreen/sur40.c
index f16f835..8375b06 100644
--- a/drivers/input/touchscreen/sur40.c
+++ b/drivers/input/touchscreen/sur40.c
@@ -81,7 +81,10 @@  struct sur40_blob {
 
 	__le32 area;       /* size in pixels/pressure (?) */
 
-	u8 padding[32];
+	u8 padding[24];
+
+	__le32 tag_id;     /* valid when type == 0x04 (SUR40_TAG) */
+	__le32 unknown;
 
 } __packed;