mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Teodora Baluta <teodora.baluta@intel.com>
To: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Teodora Baluta <teodora.baluta@intel.com>
Subject: [RFC PATCH 2/3] iio: core: change channel's storagebits/realbits to u32
Date: Thu,  4 Dec 2014 15:00:16 +0200	[thread overview]
Message-ID: <1417698017-13835-3-git-send-email-teodora.baluta@intel.com> (raw)
In-Reply-To: <1417698017-13835-1-git-send-email-teodora.baluta@intel.com>

In order to fit a channel that describes a fingerprint scan the u8 range is
not enough. For example, a scan whose height is 384 pixels and whose
width is 144, for a bit depth of 8 bits per pixels, the total bits would
be 384 x 144 x 8 = 442368, well over the u8 maximum 255 value.

Fix that by changing the realbits and storagebits fields in the
iio_chan_spec struct to u32.

Signed-off-by: Teodora Baluta <teodora.baluta@intel.com>
---
 include/linux/iio/iio.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h
index e280cfe..e34e67c 100644
--- a/include/linux/iio/iio.h
+++ b/include/linux/iio/iio.h
@@ -232,8 +232,8 @@ struct iio_chan_spec {
 	int			scan_index;
 	struct {
 		char	sign;
-		u8	realbits;
-		u8	storagebits;
+		u32	realbits;
+		u32	storagebits;
 		u8	shift;
 		u8	repeat;
 		enum iio_endian endianness;
-- 
1.9.1


  parent reply	other threads:[~2014-12-04 13:00 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-04 13:00 [RFC PATCH 0/3] Introduce IIO interface for fingerprint sensors Teodora Baluta
2014-12-04 13:00 ` [RFC PATCH 1/3] iio: core: add support for fingerprint devices Teodora Baluta
2014-12-04 13:00 ` Teodora Baluta [this message]
2014-12-04 13:00 ` [RFC PATCH 3/3] iio: fingerprint: add fingerprint sensor via USB Teodora Baluta
2014-12-05  2:15 ` [RFC PATCH 0/3] Introduce IIO interface for fingerprint sensors Jonathan Cameron
2014-12-08 14:10   ` Baluta, Teodora
2014-12-18 16:51     ` Lars-Peter Clausen
2014-12-26 11:13       ` Jonathan Cameron
2015-01-14 17:14         ` Baluta, Teodora
2015-01-15 17:37           ` Sylwester Nawrocki
2015-01-23 13:05             ` Baluta, Teodora
2015-01-23 16:46               ` Florian Echtler
2015-01-26 10:24                 ` Baluta, Teodora
2015-01-27 11:32               ` Sylwester Nawrocki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1417698017-13835-3-git-send-email-teodora.baluta@intel.com \
    --to=teodora.baluta@intel.com \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®