diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2013-03-06 06:30:08 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2013-03-21 06:12:51 -0400 |
commit | c31b9fb26069d0beedb3125a4ff3c1d0f8051d26 (patch) | |
tree | cd94685be8b2e0281051d6f4ae10fe654b8c2309 | |
parent | 739a8c91a39cd2bc3fce23ab4368816150fcf27a (diff) |
[media] siano: remove a duplicated structure definition
The same GPIO config struct was declared twice at the
driver, with different names and different macros:
struct smscore_config_gpio
struct smscore_config_gpio
Remove the one that uses CamelCase and fix the references to
its attributes/macros.
No functional changes.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r-- | drivers/media/common/siano/sms-cards.c | 18 | ||||
-rw-r--r-- | drivers/media/common/siano/smscoreapi.c | 20 | ||||
-rw-r--r-- | drivers/media/common/siano/smscoreapi.h | 55 |
3 files changed, 30 insertions, 63 deletions
diff --git a/drivers/media/common/siano/sms-cards.c b/drivers/media/common/siano/sms-cards.c index 8ee2e92b9b1a..b22b61dbc0e2 100644 --- a/drivers/media/common/siano/sms-cards.c +++ b/drivers/media/common/siano/sms-cards.c | |||
@@ -109,18 +109,18 @@ struct sms_board *sms_get_board(unsigned id) | |||
109 | } | 109 | } |
110 | EXPORT_SYMBOL_GPL(sms_get_board); | 110 | EXPORT_SYMBOL_GPL(sms_get_board); |
111 | static inline void sms_gpio_assign_11xx_default_led_config( | 111 | static inline void sms_gpio_assign_11xx_default_led_config( |
112 | struct smscore_gpio_config *pGpioConfig) { | 112 | struct smscore_config_gpio *pGpioConfig) { |
113 | pGpioConfig->Direction = SMS_GPIO_DIRECTION_OUTPUT; | 113 | pGpioConfig->direction = SMS_GPIO_DIRECTION_OUTPUT; |
114 | pGpioConfig->InputCharacteristics = | 114 | pGpioConfig->inputcharacteristics = |
115 | SMS_GPIO_INPUT_CHARACTERISTICS_NORMAL; | 115 | SMS_GPIO_INPUTCHARACTERISTICS_NORMAL; |
116 | pGpioConfig->OutputDriving = SMS_GPIO_OUTPUT_DRIVING_4mA; | 116 | pGpioConfig->outputdriving = SMS_GPIO_OUTPUTDRIVING_4mA; |
117 | pGpioConfig->OutputSlewRate = SMS_GPIO_OUTPUT_SLEW_RATE_0_45_V_NS; | 117 | pGpioConfig->outputslewrate = SMS_GPIO_OUTPUT_SLEW_RATE_0_45_V_NS; |
118 | pGpioConfig->PullUpDown = SMS_GPIO_PULL_UP_DOWN_NONE; | 118 | pGpioConfig->pullupdown = SMS_GPIO_PULLUPDOWN_NONE; |
119 | } | 119 | } |
120 | 120 | ||
121 | int sms_board_event(struct smscore_device_t *coredev, | 121 | int sms_board_event(struct smscore_device_t *coredev, |
122 | enum SMS_BOARD_EVENTS gevent) { | 122 | enum SMS_BOARD_EVENTS gevent) { |
123 | struct smscore_gpio_config MyGpioConfig; | 123 | struct smscore_config_gpio MyGpioConfig; |
124 | 124 | ||
125 | sms_gpio_assign_11xx_default_led_config(&MyGpioConfig); | 125 | sms_gpio_assign_11xx_default_led_config(&MyGpioConfig); |
126 | 126 | ||
@@ -182,7 +182,7 @@ static int sms_set_gpio(struct smscore_device_t *coredev, int pin, int enable) | |||
182 | .direction = SMS_GPIO_DIRECTION_OUTPUT, | 182 | .direction = SMS_GPIO_DIRECTION_OUTPUT, |
183 | .pullupdown = SMS_GPIO_PULLUPDOWN_NONE, | 183 | .pullupdown = SMS_GPIO_PULLUPDOWN_NONE, |
184 | .inputcharacteristics = SMS_GPIO_INPUTCHARACTERISTICS_NORMAL, | 184 | .inputcharacteristics = SMS_GPIO_INPUTCHARACTERISTICS_NORMAL, |
185 | .outputslewrate = SMS_GPIO_OUTPUTSLEWRATE_FAST, | 185 | .outputslewrate = SMS_GPIO_OUTPUT_SLEW_RATE_FAST, |
186 | .outputdriving = SMS_GPIO_OUTPUTDRIVING_S_4mA, | 186 | .outputdriving = SMS_GPIO_OUTPUTDRIVING_S_4mA, |
187 | }; | 187 | }; |
188 | 188 | ||
diff --git a/drivers/media/common/siano/smscoreapi.c b/drivers/media/common/siano/smscoreapi.c index 3b2fc872ca0b..804eb32fd8cc 100644 --- a/drivers/media/common/siano/smscoreapi.c +++ b/drivers/media/common/siano/smscoreapi.c | |||
@@ -1405,7 +1405,7 @@ static int GetGpioPinParams(u32 PinNum, u32 *pTranslatedPinNum, | |||
1405 | } | 1405 | } |
1406 | 1406 | ||
1407 | int smscore_gpio_configure(struct smscore_device_t *coredev, u8 PinNum, | 1407 | int smscore_gpio_configure(struct smscore_device_t *coredev, u8 PinNum, |
1408 | struct smscore_gpio_config *pGpioConfig) { | 1408 | struct smscore_config_gpio *pGpioConfig) { |
1409 | 1409 | ||
1410 | u32 totalLen; | 1410 | u32 totalLen; |
1411 | u32 TranslatedPinNum = 0; | 1411 | u32 TranslatedPinNum = 0; |
@@ -1452,19 +1452,19 @@ int smscore_gpio_configure(struct smscore_device_t *coredev, u8 PinNum, | |||
1452 | 1452 | ||
1453 | pMsg->msgData[1] = TranslatedPinNum; | 1453 | pMsg->msgData[1] = TranslatedPinNum; |
1454 | pMsg->msgData[2] = GroupNum; | 1454 | pMsg->msgData[2] = GroupNum; |
1455 | ElectricChar = (pGpioConfig->PullUpDown) | 1455 | ElectricChar = (pGpioConfig->pullupdown) |
1456 | | (pGpioConfig->InputCharacteristics << 2) | 1456 | | (pGpioConfig->inputcharacteristics << 2) |
1457 | | (pGpioConfig->OutputSlewRate << 3) | 1457 | | (pGpioConfig->outputslewrate << 3) |
1458 | | (pGpioConfig->OutputDriving << 4); | 1458 | | (pGpioConfig->outputdriving << 4); |
1459 | pMsg->msgData[3] = ElectricChar; | 1459 | pMsg->msgData[3] = ElectricChar; |
1460 | pMsg->msgData[4] = pGpioConfig->Direction; | 1460 | pMsg->msgData[4] = pGpioConfig->direction; |
1461 | pMsg->msgData[5] = groupCfg; | 1461 | pMsg->msgData[5] = groupCfg; |
1462 | } else { | 1462 | } else { |
1463 | pMsg->xMsgHeader.msgType = MSG_SMS_GPIO_CONFIG_EX_REQ; | 1463 | pMsg->xMsgHeader.msgType = MSG_SMS_GPIO_CONFIG_EX_REQ; |
1464 | pMsg->msgData[1] = pGpioConfig->PullUpDown; | 1464 | pMsg->msgData[1] = pGpioConfig->pullupdown; |
1465 | pMsg->msgData[2] = pGpioConfig->OutputSlewRate; | 1465 | pMsg->msgData[2] = pGpioConfig->outputslewrate; |
1466 | pMsg->msgData[3] = pGpioConfig->OutputDriving; | 1466 | pMsg->msgData[3] = pGpioConfig->outputdriving; |
1467 | pMsg->msgData[4] = pGpioConfig->Direction; | 1467 | pMsg->msgData[4] = pGpioConfig->direction; |
1468 | pMsg->msgData[5] = 0; | 1468 | pMsg->msgData[5] = 0; |
1469 | } | 1469 | } |
1470 | 1470 | ||
diff --git a/drivers/media/common/siano/smscoreapi.h b/drivers/media/common/siano/smscoreapi.h index 62f05e89da0e..f2510f50d1fe 100644 --- a/drivers/media/common/siano/smscoreapi.h +++ b/drivers/media/common/siano/smscoreapi.h | |||
@@ -638,8 +638,16 @@ struct smscore_config_gpio { | |||
638 | #define SMS_GPIO_INPUTCHARACTERISTICS_SCHMITT 1 | 638 | #define SMS_GPIO_INPUTCHARACTERISTICS_SCHMITT 1 |
639 | u8 inputcharacteristics; | 639 | u8 inputcharacteristics; |
640 | 640 | ||
641 | #define SMS_GPIO_OUTPUTSLEWRATE_FAST 0 | 641 | /* 10xx */ |
642 | #define SMS_GPIO_OUTPUTSLEWRATE_SLOW 1 | 642 | #define SMS_GPIO_OUTPUT_SLEW_RATE_FAST 0 |
643 | #define SMS_GPIO_OUTPUT_SLEW_WRATE_SLOW 1 | ||
644 | |||
645 | /* 11xx */ | ||
646 | #define SMS_GPIO_OUTPUT_SLEW_RATE_0_45_V_NS 0 | ||
647 | #define SMS_GPIO_OUTPUT_SLEW_RATE_0_9_V_NS 1 | ||
648 | #define SMS_GPIO_OUTPUT_SLEW_RATE_1_7_V_NS 2 | ||
649 | #define SMS_GPIO_OUTPUT_SLEW_RATE_3_3_V_NS 3 | ||
650 | |||
643 | u8 outputslewrate; | 651 | u8 outputslewrate; |
644 | 652 | ||
645 | /* 10xx */ | 653 | /* 10xx */ |
@@ -661,47 +669,6 @@ struct smscore_config_gpio { | |||
661 | u8 outputdriving; | 669 | u8 outputdriving; |
662 | }; | 670 | }; |
663 | 671 | ||
664 | struct smscore_gpio_config { | ||
665 | #define SMS_GPIO_DIRECTION_INPUT 0 | ||
666 | #define SMS_GPIO_DIRECTION_OUTPUT 1 | ||
667 | u8 Direction; | ||
668 | |||
669 | #define SMS_GPIO_PULL_UP_DOWN_NONE 0 | ||
670 | #define SMS_GPIO_PULL_UP_DOWN_PULLDOWN 1 | ||
671 | #define SMS_GPIO_PULL_UP_DOWN_PULLUP 2 | ||
672 | #define SMS_GPIO_PULL_UP_DOWN_KEEPER 3 | ||
673 | u8 PullUpDown; | ||
674 | |||
675 | #define SMS_GPIO_INPUT_CHARACTERISTICS_NORMAL 0 | ||
676 | #define SMS_GPIO_INPUT_CHARACTERISTICS_SCHMITT 1 | ||
677 | u8 InputCharacteristics; | ||
678 | |||
679 | #define SMS_GPIO_OUTPUT_SLEW_RATE_SLOW 1 /* 10xx */ | ||
680 | #define SMS_GPIO_OUTPUT_SLEW_RATE_FAST 0 /* 10xx */ | ||
681 | |||
682 | |||
683 | #define SMS_GPIO_OUTPUT_SLEW_RATE_0_45_V_NS 0 /* 11xx */ | ||
684 | #define SMS_GPIO_OUTPUT_SLEW_RATE_0_9_V_NS 1 /* 11xx */ | ||
685 | #define SMS_GPIO_OUTPUT_SLEW_RATE_1_7_V_NS 2 /* 11xx */ | ||
686 | #define SMS_GPIO_OUTPUT_SLEW_RATE_3_3_V_NS 3 /* 11xx */ | ||
687 | u8 OutputSlewRate; | ||
688 | |||
689 | #define SMS_GPIO_OUTPUT_DRIVING_S_4mA 0 /* 10xx */ | ||
690 | #define SMS_GPIO_OUTPUT_DRIVING_S_8mA 1 /* 10xx */ | ||
691 | #define SMS_GPIO_OUTPUT_DRIVING_S_12mA 2 /* 10xx */ | ||
692 | #define SMS_GPIO_OUTPUT_DRIVING_S_16mA 3 /* 10xx */ | ||
693 | |||
694 | #define SMS_GPIO_OUTPUT_DRIVING_1_5mA 0 /* 11xx */ | ||
695 | #define SMS_GPIO_OUTPUT_DRIVING_2_8mA 1 /* 11xx */ | ||
696 | #define SMS_GPIO_OUTPUT_DRIVING_4mA 2 /* 11xx */ | ||
697 | #define SMS_GPIO_OUTPUT_DRIVING_7mA 3 /* 11xx */ | ||
698 | #define SMS_GPIO_OUTPUT_DRIVING_10mA 4 /* 11xx */ | ||
699 | #define SMS_GPIO_OUTPUT_DRIVING_11mA 5 /* 11xx */ | ||
700 | #define SMS_GPIO_OUTPUT_DRIVING_14mA 6 /* 11xx */ | ||
701 | #define SMS_GPIO_OUTPUT_DRIVING_16mA 7 /* 11xx */ | ||
702 | u8 OutputDriving; | ||
703 | }; | ||
704 | |||
705 | extern void smscore_registry_setmode(char *devpath, int mode); | 672 | extern void smscore_registry_setmode(char *devpath, int mode); |
706 | extern int smscore_registry_getmode(char *devpath); | 673 | extern int smscore_registry_getmode(char *devpath); |
707 | 674 | ||
@@ -750,7 +717,7 @@ int smscore_set_gpio(struct smscore_device_t *coredev, u32 pin, int level); | |||
750 | 717 | ||
751 | /* new GPIO management */ | 718 | /* new GPIO management */ |
752 | extern int smscore_gpio_configure(struct smscore_device_t *coredev, u8 PinNum, | 719 | extern int smscore_gpio_configure(struct smscore_device_t *coredev, u8 PinNum, |
753 | struct smscore_gpio_config *pGpioConfig); | 720 | struct smscore_config_gpio *pGpioConfig); |
754 | extern int smscore_gpio_set_level(struct smscore_device_t *coredev, u8 PinNum, | 721 | extern int smscore_gpio_set_level(struct smscore_device_t *coredev, u8 PinNum, |
755 | u8 NewLevel); | 722 | u8 NewLevel); |
756 | extern int smscore_gpio_get_level(struct smscore_device_t *coredev, u8 PinNum, | 723 | extern int smscore_gpio_get_level(struct smscore_device_t *coredev, u8 PinNum, |