Skip to content

Commit 2b75799

Browse files
committed
extcon: max77693: Set default uart/usb path by using platform data
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>
1 parent ae3b321 commit 2b75799

2 files changed

Lines changed: 31 additions & 0 deletions

File tree

‎drivers/extcon/extcon-max77693.c‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,13 @@ struct max77693_muic_info {
6363

6464
/* Button of dock device */
6565
struct input_dev *dock;
66+
67+
/*
68+
* Default usb/uart path whether UART/USB or AUX_UART/AUX_USB
69+
* h/w path of COMP2/COMN1 on CONTROL1 register.
70+
*/
71+
int path_usb;
72+
int path_uart;
6673
};
6774

6875
enum max77693_muic_cable_group {
@@ -1058,6 +1065,23 @@ static int max77693_muic_probe(struct platform_device *pdev)
10581065
= muic_pdata->init_data[i].data;
10591066
}
10601067

1068+
/*
1069+
* Default usb/uart path whether UART/USB or AUX_UART/AUX_USB
1070+
* h/w path of COMP2/COMN1 on CONTROL1 register.
1071+
*/
1072+
if (muic_pdata->path_uart)
1073+
info->path_uart = muic_pdata->path_uart;
1074+
else
1075+
info->path_uart = CONTROL1_SW_UART;
1076+
1077+
if (muic_pdata->path_usb)
1078+
info->path_usb = muic_pdata->path_usb;
1079+
else
1080+
info->path_usb = CONTROL1_SW_USB;
1081+
1082+
/* Set initial path for UART */
1083+
max77693_muic_set_path(info, info->path_uart, true);
1084+
10611085
/* Check revision number of MUIC device*/
10621086
ret = max77693_read_reg(info->max77693->regmap_muic,
10631087
MAX77693_MUIC_REG_ID, &id);

‎include/linux/mfd/max77693.h‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,13 @@ struct max77693_muic_platform_data {
4040
int num_init_data;
4141

4242
int detcable_delay_ms;
43+
44+
/*
45+
* Default usb/uart path whether UART/USB or AUX_UART/AUX_USB
46+
* h/w path of COMP2/COMN1 on CONTROL1 register.
47+
*/
48+
int path_usb;
49+
int path_uart;
4350
};
4451

4552
struct max77693_platform_data {

0 commit comments

Comments
 (0)