From: Lars-Peter Clausen Date: Mon, 13 Feb 2012 09:25:33 +0000 (+0100) Subject: staging:iio: Add missing event code extract macros X-Git-Tag: MMI-PSA29.97-13-9~17268^2~163 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f30f929fcd6c8d2cae8ec4396534337886e414c0;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git staging:iio: Add missing event code extract macros Add macros for extracting whether the event is for a differential channel and the second channel number from the event code. These were the only two fields which did not have such an macro yet. Signed-off-by: Lars-Peter Clausen Acked-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/iio/events.h b/drivers/staging/iio/events.h index 416800e23651..c25f0e3c92e9 100644 --- a/drivers/staging/iio/events.h +++ b/drivers/staging/iio/events.h @@ -97,7 +97,9 @@ enum iio_event_direction { /* Event code number extraction depends on which type of event we have. * Perhaps review this function in the future*/ #define IIO_EVENT_CODE_EXTRACT_CHAN(mask) ((__s16)(mask & 0xFFFF)) +#define IIO_EVENT_CODE_EXTRACT_CHAN2(mask) ((__s16)(((mask) >> 16) & 0xFFFF)) #define IIO_EVENT_CODE_EXTRACT_MODIFIER(mask) ((mask >> 40) & 0xFF) +#define IIO_EVENT_CODE_EXTRACT_DIFF(mask) (((mask) >> 55) & 0x1) #endif