media: em28xx-reg.h: Fix coding style issues

Use BIT() macros and fix one comment that is not following
the Kernel coding style.

It should be noticed that the registers bit masks should be
casted to unsigned char, as, otherwise, it would produce
warnings like:

	drivers/media/usb/em28xx/em28xx-cards.c:81:33: warning: large integer implicitly truncated to unsigned type [-Woverflow]
	  {EM2820_R08_GPIO_CTRL, 0x6d,   ~EM_GPIO_4, 10},
	                                 ^

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
This commit is contained in:
Mauro Carvalho Chehab 2018-03-03 11:54:19 -05:00
parent c69ce61563
commit 2e1e84c587

View File

@ -4,19 +4,19 @@
* em28xx-reg.h - Register definitions for em28xx driver
*/
#define EM_GPIO_0 (1 << 0)
#define EM_GPIO_1 (1 << 1)
#define EM_GPIO_2 (1 << 2)
#define EM_GPIO_3 (1 << 3)
#define EM_GPIO_4 (1 << 4)
#define EM_GPIO_5 (1 << 5)
#define EM_GPIO_6 (1 << 6)
#define EM_GPIO_7 (1 << 7)
#define EM_GPIO_0 ((unsigned char)BIT(0))
#define EM_GPIO_1 ((unsigned char)BIT(1))
#define EM_GPIO_2 ((unsigned char)BIT(2))
#define EM_GPIO_3 ((unsigned char)BIT(3))
#define EM_GPIO_4 ((unsigned char)BIT(4))
#define EM_GPIO_5 ((unsigned char)BIT(5))
#define EM_GPIO_6 ((unsigned char)BIT(6))
#define EM_GPIO_7 ((unsigned char)BIT(7))
#define EM_GPO_0 (1 << 0)
#define EM_GPO_1 (1 << 1)
#define EM_GPO_2 (1 << 2)
#define EM_GPO_3 (1 << 3)
#define EM_GPO_0 ((unsigned char)BIT(0))
#define EM_GPO_1 ((unsigned char)BIT(1))
#define EM_GPO_2 ((unsigned char)BIT(2))
#define EM_GPO_3 ((unsigned char)BIT(3))
/* em28xx endpoints */
/* 0x82: (always ?) analog */
@ -208,10 +208,11 @@
#define EM28XX_R43_AC97BUSY 0x43
#define EM28XX_R45_IR 0x45
/* 0x45 bit 7 - parity bit
bits 6-0 - count
0x46 IR brand
0x47 IR data
/*
* 0x45 bit 7 - parity bit
* bits 6-0 - count
* 0x46 IR brand
* 0x47 IR data
*/
/* em2874 registers */
@ -254,12 +255,12 @@
#define EM2874_IR_RC6_MODE_6A 0x0b
/* em2874 Transport Stream Enable Register (0x5f) */
#define EM2874_TS1_CAPTURE_ENABLE (1 << 0)
#define EM2874_TS1_FILTER_ENABLE (1 << 1)
#define EM2874_TS1_NULL_DISCARD (1 << 2)
#define EM2874_TS2_CAPTURE_ENABLE (1 << 4)
#define EM2874_TS2_FILTER_ENABLE (1 << 5)
#define EM2874_TS2_NULL_DISCARD (1 << 6)
#define EM2874_TS1_CAPTURE_ENABLE ((unsigned char)BIT(0))
#define EM2874_TS1_FILTER_ENABLE ((unsigned char)BIT(1))
#define EM2874_TS1_NULL_DISCARD ((unsigned char)BIT(2))
#define EM2874_TS2_CAPTURE_ENABLE ((unsigned char)BIT(4))
#define EM2874_TS2_FILTER_ENABLE ((unsigned char)BIT(5))
#define EM2874_TS2_NULL_DISCARD ((unsigned char)BIT(6))
/* register settings */
#define EM2800_AUDIO_SRC_TUNER 0x0d