Update extcon for 4.21

Detailed description for this pull request:
 1. Fix minor issue of Maxim MUIC (Micro USB IC) device driver
 - Avoid forcing UART path on probe for extcon-max77843/77693/14577/8997.c
 - Set USB path in USB device mode for extcon-max8997.c
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJcD0bnAAoJEJzN3yze689T7J4P/3jVyv/mHYaYDmICzeoanSJp
 yLg47Fka3v2K3MJ9hEakbFtkJdn6p3aM/mv0+Ck4EQ4GinS32iMBp1gDGfLhHDtD
 Fl5X2U0h4rwsU0BsjGSERxwpK068VAe+3o4ZpJ9M51EJktUo0yQSwcR+uPx2lkWO
 GcX3FbLAtjIv0OhOixtjMN1zyjOki0/lZtEdOlRdMi53LH2pq8PbLHeBaFv1N8Kp
 IUwcBZyIYZA1B6FmfPAa+35dXWdbdnw7iCoNJhGdfIsaZABd0c27tMom58d+CGXq
 ZBjGUVy+rAmx5uNm+Hf+HAMt0a4E41/vs+pP0zqBVSuC/QHcxqQqyFRoZ9+ZkFIa
 1wY5vit+tBerWbOdc0Yv9axHsV2eAle4gCgO8O7W4eCoA7ji/OP6124BhjdU79GF
 hs/4hPJQ+k799Qlg9EslFoF0VVl93YrVqw8jIl2Z+55S6aWsj3psa9Ls+CJGRqYk
 ZGnsHioArJA2qvBkg5YZj1HAd0ht6QniNKUCkfMadwJX3BkznftBtceB6eUVRild
 FY48xKoZ5jJ4Nq8AAL9L1qVkF7kEuNak6qc7pTMJLcf6YLxFMO5c6S2aigTwBEM3
 /GVj5W19m3lae665v2kwO9FGC4g8ZkemcpdDf2KJ9LSzPh30W0pZMzahB7Y8JFhu
 o8/2uXXeAcxVEB1N0snz
 =Jndx
 -----END PGP SIGNATURE-----

Merge tag 'extcon-next-for-4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/extcon into char-misc-next

Chanwoo writes:

Update extcon for 4.21

Detailed description for this pull request:
1. Fix minor issue of Maxim MUIC (Micro USB IC) device driver
- Avoid forcing UART path on probe for extcon-max77843/77693/14577/8997.c
- Set USB path in USB device mode for extcon-max8997.c

* tag 'extcon-next-for-4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/extcon:
  extcon: max8997: Fix lack of path setting in USB device mode
  extcon: max8997: Avoid forcing UART path on drive probe
  extcon: max14577: Avoid forcing UART path on drive probe
  extcon: max77693: Avoid forcing UART path on drive probe
  extcon: max77843: Avoid forcing UART path on drive probe
This commit is contained in:
Greg Kroah-Hartman 2018-12-11 14:24:54 +01:00
commit 2701e804f0
4 changed files with 59 additions and 15 deletions

View File

@ -657,6 +657,8 @@ static int max14577_muic_probe(struct platform_device *pdev)
struct max14577 *max14577 = dev_get_drvdata(pdev->dev.parent);
struct max14577_muic_info *info;
int delay_jiffies;
int cable_type;
bool attached;
int ret;
int i;
u8 id;
@ -725,8 +727,17 @@ static int max14577_muic_probe(struct platform_device *pdev)
info->path_uart = CTRL1_SW_UART;
delay_jiffies = msecs_to_jiffies(DELAY_MS_DEFAULT);
/* Set initial path for UART */
max14577_muic_set_path(info, info->path_uart, true);
/* Set initial path for UART when JIG is connected to get serial logs */
ret = max14577_bulk_read(info->max14577->regmap,
MAX14577_MUIC_REG_STATUS1, info->status, 2);
if (ret) {
dev_err(info->dev, "Cannot read STATUS registers\n");
return ret;
}
cable_type = max14577_muic_get_cable_type(info, MAX14577_CABLE_GROUP_ADC,
&attached);
if (attached && cable_type == MAX14577_MUIC_ADC_FACTORY_MODE_UART_OFF)
max14577_muic_set_path(info, info->path_uart, true);
/* Check revision number of MUIC device*/
ret = max14577_read_reg(info->max14577->regmap,

View File

@ -1072,6 +1072,8 @@ static int max77693_muic_probe(struct platform_device *pdev)
struct max77693_reg_data *init_data;
int num_init_data;
int delay_jiffies;
int cable_type;
bool attached;
int ret;
int i;
unsigned int id;
@ -1212,8 +1214,18 @@ static int max77693_muic_probe(struct platform_device *pdev)
delay_jiffies = msecs_to_jiffies(DELAY_MS_DEFAULT);
}
/* Set initial path for UART */
max77693_muic_set_path(info, info->path_uart, true);
/* Set initial path for UART when JIG is connected to get serial logs */
ret = regmap_bulk_read(info->max77693->regmap_muic,
MAX77693_MUIC_REG_STATUS1, info->status, 2);
if (ret) {
dev_err(info->dev, "failed to read MUIC register\n");
return ret;
}
cable_type = max77693_muic_get_cable_type(info,
MAX77693_CABLE_GROUP_ADC, &attached);
if (attached && (cable_type == MAX77693_MUIC_ADC_FACTORY_MODE_UART_ON ||
cable_type == MAX77693_MUIC_ADC_FACTORY_MODE_UART_OFF))
max77693_muic_set_path(info, info->path_uart, true);
/* Check revision number of MUIC device*/
ret = regmap_read(info->max77693->regmap_muic,

View File

@ -812,6 +812,8 @@ static int max77843_muic_probe(struct platform_device *pdev)
struct max77693_dev *max77843 = dev_get_drvdata(pdev->dev.parent);
struct max77843_muic_info *info;
unsigned int id;
int cable_type;
bool attached;
int i, ret;
info = devm_kzalloc(&pdev->dev, sizeof(*info), GFP_KERNEL);
@ -856,9 +858,19 @@ static int max77843_muic_probe(struct platform_device *pdev)
/* Set ADC debounce time */
max77843_muic_set_debounce_time(info, MAX77843_DEBOUNCE_TIME_25MS);
/* Set initial path for UART */
max77843_muic_set_path(info, MAX77843_MUIC_CONTROL1_SW_UART, true,
false);
/* Set initial path for UART when JIG is connected to get serial logs */
ret = regmap_bulk_read(max77843->regmap_muic,
MAX77843_MUIC_REG_STATUS1, info->status,
MAX77843_MUIC_STATUS_NUM);
if (ret) {
dev_err(info->dev, "Cannot read STATUS registers\n");
goto err_muic_irq;
}
cable_type = max77843_muic_get_cable_type(info, MAX77843_CABLE_GROUP_ADC,
&attached);
if (attached && cable_type == MAX77843_MUIC_ADC_FACTORY_MODE_UART_OFF)
max77843_muic_set_path(info, MAX77843_MUIC_CONTROL1_SW_UART,
true, false);
/* Check revision number of MUIC device */
ret = regmap_read(max77843->regmap_muic, MAX77843_MUIC_REG_ID, &id);

View File

@ -311,12 +311,10 @@ 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, info->path_usb, attached);
if (ret < 0) {
dev_err(info->dev, "failed to update muic register\n");
return ret;
}
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;
}
switch (usb_type) {
@ -632,6 +630,8 @@ static int max8997_muic_probe(struct platform_device *pdev)
struct max8997_platform_data *pdata = dev_get_platdata(max8997->dev);
struct max8997_muic_info *info;
int delay_jiffies;
int cable_type;
bool attached;
int ret, i;
info = devm_kzalloc(&pdev->dev, sizeof(struct max8997_muic_info),
@ -724,8 +724,17 @@ static int max8997_muic_probe(struct platform_device *pdev)
delay_jiffies = msecs_to_jiffies(DELAY_MS_DEFAULT);
}
/* Set initial path for UART */
max8997_muic_set_path(info, info->path_uart, true);
/* Set initial path for UART when JIG is connected to get serial logs */
ret = max8997_bulk_read(info->muic, MAX8997_MUIC_REG_STATUS1,
2, info->status);
if (ret) {
dev_err(info->dev, "failed to read MUIC register\n");
return ret;
}
cable_type = max8997_muic_get_cable_type(info,
MAX8997_CABLE_GROUP_ADC, &attached);
if (attached && cable_type == MAX8997_MUIC_ADC_FACTORY_MODE_UART_OFF)
max8997_muic_set_path(info, info->path_uart, true);
/* Set ADC debounce time */
max8997_muic_set_debounce_time(info, ADC_DEBOUNCE_TIME_25MS);