]> Pileus Git - ~andy/linux/commitdiff
extcon: max77693: Set default uart/usb path by using platform data
authorChanwoo Choi <cw00.choi@samsung.com>
Thu, 6 Dec 2012 12:27:56 +0000 (21:27 +0900)
committerChanwoo Choi <cw00.choi@samsung.com>
Tue, 15 Jan 2013 06:42:16 +0000 (15:42 +0900)
This patch determine default uart/usb path by using platform data.
The MAX77693 MUIC device can possibliy set USB/UART/AUDIO/USB_AUX
/UART_AUX to internal h/w path of MUIC device. So, drvier should
determine default uart/usb path.

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Myungjoo Ham <myungjoo.ham@samsung.com>
drivers/extcon/extcon-max77693.c
include/linux/mfd/max77693.h

index 7b7f1a2a0846c5776235af7b9c68276f8dc85998..abab068adc358eb820c357f632be4dec96895954 100644 (file)
@@ -63,6 +63,13 @@ struct max77693_muic_info {
 
        /* Button of dock device */
        struct input_dev *dock;
+
+       /*
+        * Default usb/uart path whether UART/USB or AUX_UART/AUX_USB
+        * h/w path of COMP2/COMN1 on CONTROL1 register.
+        */
+       int path_usb;
+       int path_uart;
 };
 
 enum max77693_muic_cable_group {
@@ -1058,6 +1065,23 @@ static int max77693_muic_probe(struct platform_device *pdev)
                                = muic_pdata->init_data[i].data;
        }
 
+       /*
+        * Default usb/uart path whether UART/USB or AUX_UART/AUX_USB
+        * h/w path of COMP2/COMN1 on CONTROL1 register.
+        */
+       if (muic_pdata->path_uart)
+               info->path_uart = muic_pdata->path_uart;
+       else
+               info->path_uart = CONTROL1_SW_UART;
+
+       if (muic_pdata->path_usb)
+               info->path_usb = muic_pdata->path_usb;
+       else
+               info->path_usb = CONTROL1_SW_USB;
+
+       /* Set initial path for UART */
+        max77693_muic_set_path(info, info->path_uart, true);
+
        /* Check revision number of MUIC device*/
        ret = max77693_read_reg(info->max77693->regmap_muic,
                        MAX77693_MUIC_REG_ID, &id);
index 9aa9c203f28bace753165822b4dd061c26135824..3109a6c5c9489ff0d4b4615c081d823e88c2238a 100644 (file)
@@ -40,6 +40,13 @@ struct max77693_muic_platform_data {
        int num_init_data;
 
        int detcable_delay_ms;
+
+       /*
+        * Default usb/uart path whether UART/USB or AUX_UART/AUX_USB
+        * h/w path of COMP2/COMN1 on CONTROL1 register.
+        */
+       int path_usb;
+       int path_uart;
 };
 
 struct max77693_platform_data {