Skip to content

Commit

Permalink
Merge tag 'extcon-next-for-5.10-v2' of git://git.kernel.org/pub/scm/l…
Browse files Browse the repository at this point in the history
…inux/kernel/git/chanwoo/extcon into char-misc-next

Chanwoo writes:

Detailed description for this pull request:

1. Update extcon driver with minor updates:
- Covert the devicetree binding format from txt to yaml and edit
  the bidning document for extcon-ptn5150.c.

- Clean-up the code of extcon-ptn5150.c without any behavior changes.

- Replace HTTP links with HTTPS ones on extcon-palmas.c and extcon-usb-gpio.c.

- Return the proper error code on extcon-max14577/max77693/max77843.c.

- Simplify with dev_err_probe() on extcon-palmas.c.

- Use module_platform_driver to simplify the code on extcon-axp288.c.

2. Update MAINTAINERS
- Add Krzysztof Kozlowski as maintainer of NXP PTN5150A CC/extcon driver
to provide review, feedback and testing.

* tag 'extcon-next-for-5.10-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/extcon: (25 commits)
  extcon: axp288: Use module_platform_driver to simplify the code
  extcon: ptn5150: Do not print error during probe if nothing is attached
  extcon: ptn5150: Use defines for registers
  extcon: palmas: Simplify with dev_err_probe()
  extcon: max8997: Return error code of extcon_dev_allocate()
  extcon: max77843: Return error code of extcon_dev_allocate()
  extcon: max77693: Return error code of extcon_dev_allocate()
  extcon: max14577: Return error code of extcon_dev_allocate()
  extcon: ptn5150: Set the VBUS and POLARITY property capability
  extcon: ptn5150: Switch to GENMASK() and BIT() macros
  extcon: ptn5150: Deduplicate parts of dev_err_probe()
  extcon: Replace HTTP links with HTTPS ones
  MAINTAINERS: Add entry for NXP PTN5150A CC driver
  extcon: ptn5150: Convert to .probe_new
  extcon: ptn5150: Convert to module_i2c_driver
  extcon: ptn5150: Reduce the amount of logs on deferred probe
  extcon: ptn5150: Make 'vbus-gpios' optional
  extcon: ptn5150: Check current USB mode when probing
  extcon: ptn5150: Lower the noisiness of probe
  extcon: ptn5150: Simplify getting vbus-gpios with flags
  ...
  • Loading branch information
gregkh committed Oct 5, 2020
2 parents d8ccb6d + dbc8880 commit d3a9ff5
Show file tree
Hide file tree
Showing 11 changed files with 185 additions and 178 deletions.
27 changes: 0 additions & 27 deletions Documentation/devicetree/bindings/extcon/extcon-ptn5150.txt

This file was deleted.

60 changes: 60 additions & 0 deletions Documentation/devicetree/bindings/extcon/extcon-ptn5150.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/extcon/extcon-ptn5150.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: PTN5150 CC (Configuration Channel) Logic device

maintainers:
- Krzysztof Kozlowski <[email protected]>

description: |
PTN5150 is a small thin low power CC logic chip supporting the USB Type-C
connector application with CC control logic detection and indication
functions. It is interfaced to the host controller using an I2C interface.
properties:
compatible:
const: nxp,ptn5150

int-gpios:
deprecated: true
description:
GPIO pin (input) connected to the PTN5150's INTB pin.
Use "interrupts" instead.

interrupts:
maxItems: 1

reg:
maxItems: 1

vbus-gpios:
description:
GPIO pin (output) used to control VBUS. If skipped, no such control
takes place.

required:
- compatible
- interrupts
- reg

additionalProperties: false

examples:
- |
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/interrupt-controller/irq.h>
i2c {
#address-cells = <1>;
#size-cells = <0>;
ptn5150@1d {
compatible = "nxp,ptn5150";
reg = <0x1d>;
interrupt-parent = <&msmgpio>;
interrupts = <78 IRQ_TYPE_LEVEL_HIGH>;
vbus-gpios = <&msmgpio 148 GPIO_ACTIVE_HIGH>;
};
};
7 changes: 7 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -12485,6 +12485,13 @@ F: drivers/iio/gyro/fxas21002c_core.c
F: drivers/iio/gyro/fxas21002c_i2c.c
F: drivers/iio/gyro/fxas21002c_spi.c

NXP PTN5150A CC LOGIC AND EXTCON DRIVER
M: Krzysztof Kozlowski <[email protected]>
L: [email protected]
S: Maintained
F: Documentation/devicetree/bindings/extcon/extcon-ptn5150.yaml
F: drivers/extcon/extcon-ptn5150.c

NXP SGTL5000 DRIVER
M: Fabio Estevam <[email protected]>
L: [email protected] (moderated for non-subscribers)
Expand Down
13 changes: 1 addition & 12 deletions drivers/extcon/extcon-axp288.c
Original file line number Diff line number Diff line change
Expand Up @@ -491,18 +491,7 @@ static struct platform_driver axp288_extcon_driver = {
.pm = &axp288_extcon_pm_ops,
},
};

static int __init axp288_extcon_init(void)
{
return platform_driver_register(&axp288_extcon_driver);
}
module_init(axp288_extcon_init);

static void __exit axp288_extcon_exit(void)
{
platform_driver_unregister(&axp288_extcon_driver);
}
module_exit(axp288_extcon_exit);
module_platform_driver(axp288_extcon_driver);

MODULE_AUTHOR("Ramakrishna Pallala <[email protected]>");
MODULE_AUTHOR("Hans de Goede <[email protected]>");
Expand Down
2 changes: 1 addition & 1 deletion drivers/extcon/extcon-max14577.c
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,7 @@ static int max14577_muic_probe(struct platform_device *pdev)
max14577_extcon_cable);
if (IS_ERR(info->edev)) {
dev_err(&pdev->dev, "failed to allocate memory for extcon\n");
return -ENOMEM;
return PTR_ERR(info->edev);
}

ret = devm_extcon_dev_register(&pdev->dev, info->edev);
Expand Down
2 changes: 1 addition & 1 deletion drivers/extcon/extcon-max77693.c
Original file line number Diff line number Diff line change
Expand Up @@ -1157,7 +1157,7 @@ static int max77693_muic_probe(struct platform_device *pdev)
max77693_extcon_cable);
if (IS_ERR(info->edev)) {
dev_err(&pdev->dev, "failed to allocate memory for extcon\n");
return -ENOMEM;
return PTR_ERR(info->edev);
}

ret = devm_extcon_dev_register(&pdev->dev, info->edev);
Expand Down
2 changes: 1 addition & 1 deletion drivers/extcon/extcon-max77843.c
Original file line number Diff line number Diff line change
Expand Up @@ -845,7 +845,7 @@ static int max77843_muic_probe(struct platform_device *pdev)
max77843_extcon_cable);
if (IS_ERR(info->edev)) {
dev_err(&pdev->dev, "Failed to allocate memory for extcon\n");
ret = -ENODEV;
ret = PTR_ERR(info->edev);
goto err_muic_irq;
}

Expand Down
2 changes: 1 addition & 1 deletion drivers/extcon/extcon-max8997.c
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,7 @@ static int max8997_muic_probe(struct platform_device *pdev)
info->edev = devm_extcon_dev_allocate(&pdev->dev, max8997_extcon_cable);
if (IS_ERR(info->edev)) {
dev_err(&pdev->dev, "failed to allocate memory for extcon\n");
ret = -ENOMEM;
ret = PTR_ERR(info->edev);
goto err_irq;
}

Expand Down
20 changes: 7 additions & 13 deletions drivers/extcon/extcon-palmas.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/*
* Palmas USB transceiver driver
*
* Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com
* Copyright (C) 2013 Texas Instruments Incorporated - https://www.ti.com
* Author: Graeme Gregory <[email protected]>
* Author: Kishon Vijay Abraham I <[email protected]>
* Based on twl6030_usb.c
Expand Down Expand Up @@ -205,21 +205,15 @@ static int palmas_usb_probe(struct platform_device *pdev)

palmas_usb->id_gpiod = devm_gpiod_get_optional(&pdev->dev, "id",
GPIOD_IN);
if (PTR_ERR(palmas_usb->id_gpiod) == -EPROBE_DEFER) {
return -EPROBE_DEFER;
} else if (IS_ERR(palmas_usb->id_gpiod)) {
dev_err(&pdev->dev, "failed to get id gpio\n");
return PTR_ERR(palmas_usb->id_gpiod);
}
if (IS_ERR(palmas_usb->id_gpiod))
return dev_err_probe(&pdev->dev, PTR_ERR(palmas_usb->id_gpiod),
"failed to get id gpio\n");

palmas_usb->vbus_gpiod = devm_gpiod_get_optional(&pdev->dev, "vbus",
GPIOD_IN);
if (PTR_ERR(palmas_usb->vbus_gpiod) == -EPROBE_DEFER) {
return -EPROBE_DEFER;
} else if (IS_ERR(palmas_usb->vbus_gpiod)) {
dev_err(&pdev->dev, "failed to get vbus gpio\n");
return PTR_ERR(palmas_usb->vbus_gpiod);
}
if (IS_ERR(palmas_usb->vbus_gpiod))
return dev_err_probe(&pdev->dev, PTR_ERR(palmas_usb->vbus_gpiod),
"failed to get id gpio\n");

if (palmas_usb->enable_id_detection && palmas_usb->id_gpiod) {
palmas_usb->enable_id_detection = false;
Expand Down
Loading

0 comments on commit d3a9ff5

Please sign in to comment.