aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChanwoo Choi <cw00.choi@samsung.com>2013-08-22 21:21:37 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-09-26 15:03:30 -0400
commitc2275d2fa587712d285a4db97a68322a233ad2c8 (patch)
tree572602db3866ccd4ad67efd32c41f600ee75bf55
parent30399bbfa698689e81f9507992034fe09700941b (diff)
extcon: Fix up 80 column coding style issues
This patch fix 80 column coding sytle issues by using checkpatch script. Cc: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Cc: Mark Brown <broonie@kernel.org> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: Myungjoo Ham <myungjoo.ham@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/extcon/extcon-arizona.c25
-rw-r--r--drivers/extcon/extcon-class.c6
-rw-r--r--drivers/extcon/extcon-max77693.c129
-rw-r--r--drivers/extcon/extcon-max8997.c6
4 files changed, 94 insertions, 72 deletions
diff --git a/drivers/extcon/extcon-arizona.c b/drivers/extcon/extcon-arizona.c
index e55713083c78..9431092f52fc 100644
--- a/drivers/extcon/extcon-arizona.c
+++ b/drivers/extcon/extcon-arizona.c
@@ -738,8 +738,8 @@ err:
738static void arizona_micd_timeout_work(struct work_struct *work) 738static void arizona_micd_timeout_work(struct work_struct *work)
739{ 739{
740 struct arizona_extcon_info *info = container_of(work, 740 struct arizona_extcon_info *info = container_of(work,
741 struct arizona_extcon_info, 741 struct arizona_extcon_info,
742 micd_timeout_work.work); 742 micd_timeout_work.work);
743 743
744 mutex_lock(&info->lock); 744 mutex_lock(&info->lock);
745 745
@@ -756,8 +756,8 @@ static void arizona_micd_timeout_work(struct work_struct *work)
756static void arizona_micd_detect(struct work_struct *work) 756static void arizona_micd_detect(struct work_struct *work)
757{ 757{
758 struct arizona_extcon_info *info = container_of(work, 758 struct arizona_extcon_info *info = container_of(work,
759 struct arizona_extcon_info, 759 struct arizona_extcon_info,
760 micd_detect_work.work); 760 micd_detect_work.work);
761 struct arizona *arizona = info->arizona; 761 struct arizona *arizona = info->arizona;
762 unsigned int val = 0, lvl; 762 unsigned int val = 0, lvl;
763 int ret, i, key; 763 int ret, i, key;
@@ -769,7 +769,8 @@ static void arizona_micd_detect(struct work_struct *work)
769 for (i = 0; i < 10 && !(val & 0x7fc); i++) { 769 for (i = 0; i < 10 && !(val & 0x7fc); i++) {
770 ret = regmap_read(arizona->regmap, ARIZONA_MIC_DETECT_3, &val); 770 ret = regmap_read(arizona->regmap, ARIZONA_MIC_DETECT_3, &val);
771 if (ret != 0) { 771 if (ret != 0) {
772 dev_err(arizona->dev, "Failed to read MICDET: %d\n", ret); 772 dev_err(arizona->dev,
773 "Failed to read MICDET: %d\n", ret);
773 mutex_unlock(&info->lock); 774 mutex_unlock(&info->lock);
774 return; 775 return;
775 } 776 }
@@ -777,7 +778,8 @@ static void arizona_micd_detect(struct work_struct *work)
777 dev_dbg(arizona->dev, "MICDET: %x\n", val); 778 dev_dbg(arizona->dev, "MICDET: %x\n", val);
778 779
779 if (!(val & ARIZONA_MICD_VALID)) { 780 if (!(val & ARIZONA_MICD_VALID)) {
780 dev_warn(arizona->dev, "Microphone detection state invalid\n"); 781 dev_warn(arizona->dev,
782 "Microphone detection state invalid\n");
781 mutex_unlock(&info->lock); 783 mutex_unlock(&info->lock);
782 return; 784 return;
783 } 785 }
@@ -925,8 +927,8 @@ static irqreturn_t arizona_micdet(int irq, void *data)
925static void arizona_hpdet_work(struct work_struct *work) 927static void arizona_hpdet_work(struct work_struct *work)
926{ 928{
927 struct arizona_extcon_info *info = container_of(work, 929 struct arizona_extcon_info *info = container_of(work,
928 struct arizona_extcon_info, 930 struct arizona_extcon_info,
929 hpdet_work.work); 931 hpdet_work.work);
930 932
931 mutex_lock(&info->lock); 933 mutex_lock(&info->lock);
932 arizona_start_hpdet_acc_id(info); 934 arizona_start_hpdet_acc_id(info);
@@ -973,10 +975,13 @@ static irqreturn_t arizona_jackdet(int irq, void *data)
973 &info->hpdet_work, 975 &info->hpdet_work,
974 msecs_to_jiffies(HPDET_DEBOUNCE)); 976 msecs_to_jiffies(HPDET_DEBOUNCE));
975 977
976 if (cancelled_mic) 978 if (cancelled_mic) {
979 int micd_timeout = info->micd_timeout;
980
977 queue_delayed_work(system_power_efficient_wq, 981 queue_delayed_work(system_power_efficient_wq,
978 &info->micd_timeout_work, 982 &info->micd_timeout_work,
979 msecs_to_jiffies(info->micd_timeout)); 983 msecs_to_jiffies(micd_timeout));
984 }
980 985
981 goto out; 986 goto out;
982 } 987 }
diff --git a/drivers/extcon/extcon-class.c b/drivers/extcon/extcon-class.c
index 148382faded9..17544320d1a6 100644
--- a/drivers/extcon/extcon-class.c
+++ b/drivers/extcon/extcon-class.c
@@ -452,7 +452,8 @@ int extcon_register_interest(struct extcon_specific_cable_nb *obj,
452 if (!obj->edev) 452 if (!obj->edev)
453 return -ENODEV; 453 return -ENODEV;
454 454
455 obj->cable_index = extcon_find_cable_index(obj->edev, cable_name); 455 obj->cable_index = extcon_find_cable_index(obj->edev,
456 cable_name);
456 if (obj->cable_index < 0) 457 if (obj->cable_index < 0)
457 return obj->cable_index; 458 return obj->cable_index;
458 459
@@ -460,7 +461,8 @@ int extcon_register_interest(struct extcon_specific_cable_nb *obj,
460 461
461 obj->internal_nb.notifier_call = _call_per_cable; 462 obj->internal_nb.notifier_call = _call_per_cable;
462 463
463 return raw_notifier_chain_register(&obj->edev->nh, &obj->internal_nb); 464 return raw_notifier_chain_register(&obj->edev->nh,
465 &obj->internal_nb);
464 } else { 466 } else {
465 struct class_dev_iter iter; 467 struct class_dev_iter iter;
466 struct extcon_dev *extd; 468 struct extcon_dev *extd;
diff --git a/drivers/extcon/extcon-max77693.c b/drivers/extcon/extcon-max77693.c
index b56bdaa27d4b..5ee0344f734d 100644
--- a/drivers/extcon/extcon-max77693.c
+++ b/drivers/extcon/extcon-max77693.c
@@ -189,14 +189,17 @@ enum max77693_muic_acc_type {
189 189
190 /* The below accessories have same ADC value so ADCLow and 190 /* The below accessories have same ADC value so ADCLow and
191 ADC1K bit is used to separate specific accessory */ 191 ADC1K bit is used to separate specific accessory */
192 MAX77693_MUIC_GND_USB_OTG = 0x100, /* ADC:0x0, VBVolot:0, ADCLow:0, ADC1K:0 */ 192 /* ADC|VBVolot|ADCLow|ADC1K| */
193 MAX77693_MUIC_GND_USB_OTG_VB = 0x104, /* ADC:0x0, VBVolot:1, ADCLow:0, ADC1K:0 */ 193 MAX77693_MUIC_GND_USB_OTG = 0x100, /* 0x0| 0| 0| 0| */
194 MAX77693_MUIC_GND_AV_CABLE_LOAD = 0x102,/* ADC:0x0, VBVolot:0, ADCLow:1, ADC1K:0 */ 194 MAX77693_MUIC_GND_USB_OTG_VB = 0x104, /* 0x0| 1| 0| 0| */
195 MAX77693_MUIC_GND_MHL = 0x103, /* ADC:0x0, VBVolot:0, ADCLow:1, ADC1K:1 */ 195 MAX77693_MUIC_GND_AV_CABLE_LOAD = 0x102,/* 0x0| 0| 1| 0| */
196 MAX77693_MUIC_GND_MHL_VB = 0x107, /* ADC:0x0, VBVolot:1, ADCLow:1, ADC1K:1 */ 196 MAX77693_MUIC_GND_MHL = 0x103, /* 0x0| 0| 1| 1| */
197 MAX77693_MUIC_GND_MHL_VB = 0x107, /* 0x0| 1| 1| 1| */
197}; 198};
198 199
199/* MAX77693 MUIC device support below list of accessories(external connector) */ 200/*
201 * MAX77693 MUIC device support below list of accessories(external connector)
202 */
200enum { 203enum {
201 EXTCON_CABLE_USB = 0, 204 EXTCON_CABLE_USB = 0,
202 EXTCON_CABLE_USB_HOST, 205 EXTCON_CABLE_USB_HOST,
@@ -395,12 +398,12 @@ static int max77693_muic_get_cable_type(struct max77693_muic_info *info,
395 vbvolt >>= STATUS2_VBVOLT_SHIFT; 398 vbvolt >>= STATUS2_VBVOLT_SHIFT;
396 399
397 /** 400 /**
398 * [0x1][VBVolt][ADCLow][ADC1K] 401 * [0x1|VBVolt|ADCLow|ADC1K]
399 * [0x1 0 0 0 ] : USB_OTG 402 * [0x1| 0| 0| 0] USB_OTG
400 * [0x1 1 0 0 ] : USB_OTG_VB 403 * [0x1| 1| 0| 0] USB_OTG_VB
401 * [0x1 0 1 0 ] : Audio Video Cable with load 404 * [0x1| 0| 1| 0] Audio Video cable with load
402 * [0x1 0 1 1 ] : MHL without charging connector 405 * [0x1| 0| 1| 1] MHL without charging cable
403 * [0x1 1 1 1 ] : MHL with charging connector 406 * [0x1| 1| 1| 1] MHL with charging cable
404 */ 407 */
405 cable_type = ((0x1 << 8) 408 cable_type = ((0x1 << 8)
406 | (vbvolt << 2) 409 | (vbvolt << 2)
@@ -723,11 +726,11 @@ static int max77693_muic_adc_handler(struct max77693_muic_info *info)
723 if (ret < 0) 726 if (ret < 0)
724 return ret; 727 return ret;
725 break; 728 break;
726 case MAX77693_MUIC_ADC_REMOTE_S3_BUTTON: /* DOCK_KEY_PREV */ 729 case MAX77693_MUIC_ADC_REMOTE_S3_BUTTON: /* DOCK_KEY_PREV */
727 case MAX77693_MUIC_ADC_REMOTE_S7_BUTTON: /* DOCK_KEY_NEXT */ 730 case MAX77693_MUIC_ADC_REMOTE_S7_BUTTON: /* DOCK_KEY_NEXT */
728 case MAX77693_MUIC_ADC_REMOTE_S9_BUTTON: /* DOCK_VOL_DOWN */ 731 case MAX77693_MUIC_ADC_REMOTE_S9_BUTTON: /* DOCK_VOL_DOWN */
729 case MAX77693_MUIC_ADC_REMOTE_S10_BUTTON: /* DOCK_VOL_UP */ 732 case MAX77693_MUIC_ADC_REMOTE_S10_BUTTON: /* DOCK_VOL_UP */
730 case MAX77693_MUIC_ADC_REMOTE_S12_BUTTON: /* DOCK_KEY_PLAY_PAUSE */ 733 case MAX77693_MUIC_ADC_REMOTE_S12_BUTTON: /* DOCK_KEY_PLAY_PAUSE */
731 /* 734 /*
732 * Button of DOCK device 735 * Button of DOCK device
733 * - the Prev/Next/Volume Up/Volume Down/Play-Pause button 736 * - the Prev/Next/Volume Up/Volume Down/Play-Pause button
@@ -815,19 +818,21 @@ static int max77693_muic_chg_handler(struct max77693_muic_info *info)
815 case MAX77693_MUIC_GND_MHL_VB: 818 case MAX77693_MUIC_GND_MHL_VB:
816 /* 819 /*
817 * MHL cable with MHL_TA(USB/TA) cable 820 * MHL cable with MHL_TA(USB/TA) cable
818 * - MHL cable include two port(HDMI line and separate micro- 821 * - MHL cable include two port(HDMI line and separate
819 * usb port. When the target connect MHL cable, extcon driver 822 * micro-usb port. When the target connect MHL cable,
820 * check whether MHL_TA(USB/TA) cable is connected. If MHL_TA 823 * extcon driver check whether MHL_TA(USB/TA) cable is
821 * cable is connected, extcon driver notify state to notifiee 824 * connected. If MHL_TA cable is connected, extcon
822 * for charging battery. 825 * driver notify state to notifiee for charging battery.
823 * 826 *
824 * Features of 'MHL_TA(USB/TA) with MHL cable' 827 * Features of 'MHL_TA(USB/TA) with MHL cable'
825 * - Support MHL 828 * - Support MHL
826 * - Support charging through micro-usb port without data connection 829 * - Support charging through micro-usb port without
830 * data connection
827 */ 831 */
828 extcon_set_cable_state(info->edev, "MHL_TA", attached); 832 extcon_set_cable_state(info->edev, "MHL_TA", attached);
829 if (!cable_attached) 833 if (!cable_attached)
830 extcon_set_cable_state(info->edev, "MHL", cable_attached); 834 extcon_set_cable_state(info->edev,
835 "MHL", cable_attached);
831 break; 836 break;
832 } 837 }
833 838
@@ -839,47 +844,51 @@ static int max77693_muic_chg_handler(struct max77693_muic_info *info)
839 case MAX77693_MUIC_ADC_AV_CABLE_NOLOAD: /* Dock-Audio */ 844 case MAX77693_MUIC_ADC_AV_CABLE_NOLOAD: /* Dock-Audio */
840 /* 845 /*
841 * Dock-Audio device with USB/TA cable 846 * Dock-Audio device with USB/TA cable
842 * - Dock device include two port(Dock-Audio and micro-usb 847 * - Dock device include two port(Dock-Audio and micro-
843 * port). When the target connect Dock-Audio device, extcon 848 * usb port). When the target connect Dock-Audio device,
844 * driver check whether USB/TA cable is connected. If USB/TA 849 * extcon driver check whether USB/TA cable is connected
845 * cable is connected, extcon driver notify state to notifiee 850 * or not. If USB/TA cable is connected, extcon driver
846 * for charging battery. 851 * notify state to notifiee for charging battery.
847 * 852 *
848 * Features of 'USB/TA cable with Dock-Audio device' 853 * Features of 'USB/TA cable with Dock-Audio device'
849 * - Support external output feature of audio. 854 * - Support external output feature of audio.
850 * - Support charging through micro-usb port without data 855 * - Support charging through micro-usb port without
851 * connection. 856 * data connection.
852 */ 857 */
853 extcon_set_cable_state(info->edev, "USB", attached); 858 extcon_set_cable_state(info->edev, "USB", attached);
854 859
855 if (!cable_attached) 860 if (!cable_attached)
856 extcon_set_cable_state(info->edev, "Dock-Audio", cable_attached); 861 extcon_set_cable_state(info->edev, "Dock-Audio",
862 cable_attached);
857 break; 863 break;
858 case MAX77693_MUIC_ADC_RESERVED_ACC_3: /* Dock-Smart */ 864 case MAX77693_MUIC_ADC_RESERVED_ACC_3: /* Dock-Smart */
859 /* 865 /*
860 * Dock-Smart device with USB/TA cable 866 * Dock-Smart device with USB/TA cable
861 * - Dock-Desk device include three type of cable which 867 * - Dock-Desk device include three type of cable which
862 * are HDMI, USB for mouse/keyboard and micro-usb port 868 * are HDMI, USB for mouse/keyboard and micro-usb port
863 * for USB/TA cable. Dock-Smart device need always exteranl 869 * for USB/TA cable. Dock-Smart device need always
864 * power supply(USB/TA cable through micro-usb cable). Dock- 870 * exteranl power supply(USB/TA cable through micro-usb
865 * Smart device support screen output of target to separate 871 * cable). Dock-Smart device support screen output of
866 * monitor and mouse/keyboard for desktop mode. 872 * target to separate monitor and mouse/keyboard for
873 * desktop mode.
867 * 874 *
868 * Features of 'USB/TA cable with Dock-Smart device' 875 * Features of 'USB/TA cable with Dock-Smart device'
869 * - Support MHL 876 * - Support MHL
870 * - Support external output feature of audio 877 * - Support external output feature of audio
871 * - Support charging through micro-usb port without data 878 * - Support charging through micro-usb port without
872 * connection if TA cable is connected to target. 879 * data connection if TA cable is connected to target.
873 * - Support charging and data connection through micro-usb port 880 * - Support charging and data connection through micro-
874 * if USB cable is connected between target and host 881 * usb port if USB cable is connected between target
875 * device. 882 * and host device
876 * - Support OTG device (Mouse/Keyboard) 883 * - Support OTG device (Mouse/Keyboard)
877 */ 884 */
878 ret = max77693_muic_set_path(info, info->path_usb, attached); 885 ret = max77693_muic_set_path(info, info->path_usb,
886 attached);
879 if (ret < 0) 887 if (ret < 0)
880 return ret; 888 return ret;
881 889
882 extcon_set_cable_state(info->edev, "Dock-Smart", attached); 890 extcon_set_cable_state(info->edev, "Dock-Smart",
891 attached);
883 extcon_set_cable_state(info->edev, "MHL", attached); 892 extcon_set_cable_state(info->edev, "MHL", attached);
884 893
885 break; 894 break;
@@ -889,25 +898,28 @@ static int max77693_muic_chg_handler(struct max77693_muic_info *info)
889 switch (chg_type) { 898 switch (chg_type) {
890 case MAX77693_CHARGER_TYPE_NONE: 899 case MAX77693_CHARGER_TYPE_NONE:
891 /* 900 /*
892 * When MHL(with USB/TA cable) or Dock-Audio with USB/TA cable 901 * When MHL(with USB/TA cable) or Dock-Audio with USB/TA
893 * is attached, muic device happen below two interrupt. 902 * cable is attached, muic device happen below two irq.
894 * - 'MAX77693_MUIC_IRQ_INT1_ADC' for detecting MHL/Dock-Audio. 903 * - 'MAX77693_MUIC_IRQ_INT1_ADC' for detecting
895 * - 'MAX77693_MUIC_IRQ_INT2_CHGTYP' for detecting USB/TA cable 904 * MHL/Dock-Audio.
896 * connected to MHL or Dock-Audio. 905 * - 'MAX77693_MUIC_IRQ_INT2_CHGTYP' for detecting
897 * Always, happen eariler MAX77693_MUIC_IRQ_INT1_ADC interrupt 906 * USB/TA cable connected to MHL or Dock-Audio.
898 * than MAX77693_MUIC_IRQ_INT2_CHGTYP interrupt. 907 * Always, happen eariler MAX77693_MUIC_IRQ_INT1_ADC
908 * irq than MAX77693_MUIC_IRQ_INT2_CHGTYP irq.
899 * 909 *
900 * If user attach MHL (with USB/TA cable and immediately detach 910 * If user attach MHL (with USB/TA cable and immediately
901 * MHL with USB/TA cable before MAX77693_MUIC_IRQ_INT2_CHGTYP 911 * detach MHL with USB/TA cable before MAX77693_MUIC_IRQ
902 * interrupt is happened, USB/TA cable remain connected state to 912 * _INT2_CHGTYP irq is happened, USB/TA cable remain
903 * target. But USB/TA cable isn't connected to target. The user 913 * connected state to target. But USB/TA cable isn't
904 * be face with unusual action. So, driver should check this 914 * connected to target. The user be face with unusual
905 * situation in spite of, that previous charger type is N/A. 915 * action. So, driver should check this situation in
916 * spite of, that previous charger type is N/A.
906 */ 917 */
907 break; 918 break;
908 case MAX77693_CHARGER_TYPE_USB: 919 case MAX77693_CHARGER_TYPE_USB:
909 /* Only USB cable, PATH:AP_USB */ 920 /* Only USB cable, PATH:AP_USB */
910 ret = max77693_muic_set_path(info, info->path_usb, attached); 921 ret = max77693_muic_set_path(info, info->path_usb,
922 attached);
911 if (ret < 0) 923 if (ret < 0)
912 return ret; 924 return ret;
913 925
@@ -1214,7 +1226,8 @@ static int max77693_muic_probe(struct platform_device *pdev)
1214 } 1226 }
1215 1227
1216 if (pdata->muic_data) { 1228 if (pdata->muic_data) {
1217 struct max77693_muic_platform_data *muic_pdata = pdata->muic_data; 1229 struct max77693_muic_platform_data *muic_pdata
1230 = pdata->muic_data;
1218 1231
1219 /* 1232 /*
1220 * Default usb/uart path whether UART/USB or AUX_UART/AUX_USB 1233 * Default usb/uart path whether UART/USB or AUX_UART/AUX_USB
diff --git a/drivers/extcon/extcon-max8997.c b/drivers/extcon/extcon-max8997.c
index 67d6738d85a0..b9e726daefca 100644
--- a/drivers/extcon/extcon-max8997.c
+++ b/drivers/extcon/extcon-max8997.c
@@ -426,7 +426,8 @@ static int max8997_muic_adc_handler(struct max8997_muic_info *info)
426 break; 426 break;
427 case MAX8997_MUIC_ADC_FACTORY_MODE_USB_OFF: 427 case MAX8997_MUIC_ADC_FACTORY_MODE_USB_OFF:
428 case MAX8997_MUIC_ADC_FACTORY_MODE_USB_ON: 428 case MAX8997_MUIC_ADC_FACTORY_MODE_USB_ON:
429 ret = max8997_muic_handle_usb(info, MAX8997_USB_DEVICE, attached); 429 ret = max8997_muic_handle_usb(info,
430 MAX8997_USB_DEVICE, attached);
430 if (ret < 0) 431 if (ret < 0)
431 return ret; 432 return ret;
432 break; 433 break;
@@ -504,7 +505,8 @@ static int max8997_muic_chg_handler(struct max8997_muic_info *info)
504 } 505 }
505 break; 506 break;
506 case MAX8997_CHARGER_TYPE_DOWNSTREAM_PORT: 507 case MAX8997_CHARGER_TYPE_DOWNSTREAM_PORT:
507 extcon_set_cable_state(info->edev, "Charge-downstream", attached); 508 extcon_set_cable_state(info->edev,
509 "Charge-downstream", attached);
508 break; 510 break;
509 case MAX8997_CHARGER_TYPE_DEDICATED_CHG: 511 case MAX8997_CHARGER_TYPE_DEDICATED_CHG:
510 extcon_set_cable_state(info->edev, "TA", attached); 512 extcon_set_cable_state(info->edev, "TA", attached);