Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 355092
b: refs/heads/master
c: 685dc9a
h: refs/heads/master
v: v3
  • Loading branch information
Chanwoo Choi committed Feb 13, 2013
1 parent c75c9c1 commit cd5f1fd
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f73f6232af9131f7b6fc6e377267e4a441727eb3
refs/heads/master: 685dc9a7dbfede28cc4a0fe4e65804194ec04fa5
28 changes: 26 additions & 2 deletions trunk/drivers/extcon/extcon-max8997.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,13 @@ struct max8997_muic_info {

struct max8997_muic_platform_data *muic_pdata;
enum max8997_muic_charger_type pre_charger_type;

/*
* 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 {
Expand Down Expand Up @@ -322,7 +329,7 @@ static int max8997_muic_handle_usb(struct max8997_muic_info *info,
int ret = 0;

if (usb_type == MAX8997_USB_HOST) {
ret = max8997_muic_set_path(info, CONTROL1_SW_USB, attached);
ret = max8997_muic_set_path(info, info->path_usb, attached);
if (ret < 0) {
dev_err(info->dev, "failed to update muic register\n");
return ret;
Expand Down Expand Up @@ -378,7 +385,7 @@ static int max8997_muic_handle_jig_uart(struct max8997_muic_info *info,
int ret = 0;

/* switch to UART */
ret = max8997_muic_set_path(info, CONTROL1_SW_UART, attached);
ret = max8997_muic_set_path(info, info->path_uart, attached);
if (ret) {
dev_err(info->dev, "failed to update muic register\n");
return -EINVAL;
Expand Down Expand Up @@ -694,6 +701,23 @@ static int max8997_muic_probe(struct platform_device *pdev)
}
}

/*
* Default usb/uart path whether UART/USB or AUX_UART/AUX_USB
* h/w path of COMP2/COMN1 on CONTROL1 register.
*/
if (pdata->muic_pdata->path_uart)
info->path_uart = pdata->muic_pdata->path_uart;
else
info->path_uart = CONTROL1_SW_UART;

if (pdata->muic_pdata->path_usb)
info->path_usb = pdata->muic_pdata->path_usb;
else
info->path_usb = CONTROL1_SW_USB;

/* Set initial path for UART */
max8997_muic_set_path(info, info->path_uart, true);

/* Set ADC debounce time */
max8997_muic_set_debounce_time(info, ADC_DEBOUNCE_TIME_25MS);

Expand Down
7 changes: 7 additions & 0 deletions trunk/include/linux/mfd/max8997.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,13 @@ struct max8997_muic_reg_data {
struct max8997_muic_platform_data {
struct max8997_muic_reg_data *init_data;
int num_init_data;

/*
* 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 max8997_haptic_motor_type {
Expand Down

0 comments on commit cd5f1fd

Please sign in to comment.