From patchwork Fri Jun 29 11:05:25 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shubhrajyoti Datta X-Patchwork-Id: 1131511 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id DC185DFF34 for ; Fri, 29 Jun 2012 11:06:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754040Ab2F2LGA (ORCPT ); Fri, 29 Jun 2012 07:06:00 -0400 Received: from comal.ext.ti.com ([198.47.26.152]:51089 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752393Ab2F2LGA (ORCPT ); Fri, 29 Jun 2012 07:06:00 -0400 Received: from dbdp20.itg.ti.com ([172.24.170.38]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id q5TB5am2000391; Fri, 29 Jun 2012 06:05:37 -0500 Received: from DBDE70.ent.ti.com (localhost [127.0.0.1]) by dbdp20.itg.ti.com (8.13.8/8.13.8) with ESMTP id q5TB5YZA009769; Fri, 29 Jun 2012 16:35:35 +0530 (IST) Received: from dbdp33.itg.ti.com (172.24.170.252) by dbde70.ent.ti.com (172.24.170.148) with Microsoft SMTP Server id 14.1.323.3; Fri, 29 Jun 2012 16:35:34 +0530 Received: from ula0393217.india.ti.com (smtpvbd.itg.ti.com [172.24.170.250]) by dbdp33.itg.ti.com (8.13.8/8.13.8) with ESMTP id q5TB5VHO001275; Fri, 29 Jun 2012 16:35:34 +0530 From: Shubhrajyoti D To: CC: , , , , , Shubhrajyoti D , Felipe Balbi Subject: [RFC PATCH 1/3] i2c: add 'actual' field to struct i2c_msg Date: Fri, 29 Jun 2012 16:35:25 +0530 Message-ID: <1340967927-27354-2-git-send-email-shubhrajyoti@ti.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1340967927-27354-1-git-send-email-shubhrajyoti@ti.com> References: <1340967927-27354-1-git-send-email-shubhrajyoti@ti.com> MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org In case of a NACK, it's wise to tell our clients drivers about how many bytes were actually transferred. Support this by adding an extra field to the struct i2c_msg which gets incremented the amount of bytes actually transferred. Signed-off-by: Shubhrajyoti D Signed-off-by: Felipe Balbi --- include/linux/i2c.h | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/include/linux/i2c.h b/include/linux/i2c.h index ddfa041..0cb6b83 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h @@ -547,6 +547,7 @@ struct i2c_msg { #define I2C_M_NO_RD_ACK 0x0800 /* if I2C_FUNC_PROTOCOL_MANGLING */ #define I2C_M_RECV_LEN 0x0400 /* length will be first received byte */ __u16 len; /* msg length */ + __u16 actual; /* actual bytes transferred */ __u8 *buf; /* pointer to msg data */ };