dt-bindings: extcon: ptn5150: Convert binding to DT schema
Subsystems (4)
Krzysztof Kozlowski
maintainerPATCH 1/11 dt-bindings: extcon: ptn5150: Convert binding to DT schema
Convert the ptn-5150 extcon driver bindings to DT schema format using json-schema. The differences with original bindings document:
- Use "gpios" suffix for the "int" and "vbus" gpio,
- Skip generic properties like "reg" or "pinctrl".
--- .../bindings/extcon/extcon-ptn5150.txt | 27 ---------- .../bindings/extcon/extcon-ptn5150.yaml | 53 +++++++++++++++++++ 2 files changed, 53 insertions(+), 27 deletions(-) delete mode 100644 Documentation/devicetree/bindings/extcon/extcon-ptn5150.txt create mode 100644 Documentation/devicetree/bindings/extcon/extcon-ptn5150.yaml
Documentation/devicetree/bindings/extcon/extcon-ptn5150.txt deleted +0 -27
@@ -1,27 +0,0 @@ -* PTN5150 CC (Configuration Channel) Logic device - -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. - -Required properties: -- compatible: should be "nxp,ptn5150" -- reg: specifies the I2C slave address of the device -- int-gpio: should contain a phandle and GPIO specifier for the GPIO pin - connected to the PTN5150's INTB pin. -- vbus-gpio: should contain a phandle and GPIO specifier for the GPIO pin which - is used to control VBUS. -- pinctrl-names : a pinctrl state named "default" must be defined. -- pinctrl-0 : phandle referencing pin configuration of interrupt and vbus - control. - -Example: - ptn5150@1d { - compatible = "nxp,ptn5150"; - reg = <0x1d>; - int-gpio = <&msmgpio 78 GPIO_ACTIVE_HIGH>; - vbus-gpio = <&msmgpio 148 GPIO_ACTIVE_HIGH>; - pinctrl-names = "default"; - pinctrl-0 = <&ptn5150_default>; - status = "okay"; - };
Documentation/devicetree/bindings/extcon/extcon-ptn5150.yaml new file +53 -0
53 lines not on this page · raw message
Signature · 1 line
2.17.1
Krzysztof Kozlowski
maintainerPATCH 2/11 dt-bindings: extcon: ptn5150: Use generic "interrupts" property
Interrupts do not have to be always GPIO based so instead of expecting "int-gpios" property and converting the GPIO to an interrupt, just accept any interrupt via generic "interrupts" property.
Mark the old "int-gpios" as deprecated.
--- .../devicetree/bindings/extcon/extcon-ptn5150.yaml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/extcon/extcon-ptn5150.yaml +9 -2
@@ -19,8 +19,13 @@ properties: 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
@@ -31,7 +36,7 @@ properties: required: - compatible - - int-gpios + - interrupts - reg - vbus-gpios
@@ -40,6 +45,7 @@ additionalProperties: false examples: - | #include <dt-bindings/gpio/gpio.h> + #include <dt-bindings/interrupt-controller/irq.h> i2c { #address-cells = <1>; #size-cells = <0>;
@@ -47,7 +53,8 @@ examples: ptn5150@1d { compatible = "nxp,ptn5150"; reg = <0x1d>; - int-gpios = <&msmgpio 78 GPIO_ACTIVE_HIGH>; + interrupt-parent = <&msmgpio>; + interrupts = <78 IRQ_TYPE_LEVEL_HIGH>; vbus-gpios = <&msmgpio 148 GPIO_ACTIVE_HIGH>; }; };
Signature · 1 line
2.17.1
Krzysztof Kozlowski
maintainerPATCH 3/11 dt-bindings: extcon: ptn5150: Make 'vbus-gpios' optional
In reply to Krzysztof KozlowskiThe PTN5150 chip can be used in hardware designs with only reporting of USB Type-C connection, without the VBUS control.
--- Documentation/devicetree/bindings/extcon/extcon-ptn5150.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/extcon/extcon-ptn5150.yaml +2 -2
@@ -32,13 +32,13 @@ properties: vbus-gpios: description: - GPIO pin (output) used to control VBUS. + GPIO pin (output) used to control VBUS. If skipped, no such control + takes place. required: - compatible - interrupts - reg - - vbus-gpios additionalProperties: false
Signature · 1 line
2.17.1
Krzysztof Kozlowski
maintainerPATCH 4/11 extcon: ptn5150: Fix usage of atomic GPIO with sleeping GPIO chips
In reply to Krzysztof KozlowskiThe driver uses atomic version of gpiod_set_value() without any real reason. It is called in a workqueue under mutex so it could sleep there. Changing it to "can_sleep" flavor allows to use the driver with all GPIO chips.
--- drivers/extcon/extcon-ptn5150.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/extcon/extcon-ptn5150.c +4 -4
@@ -127,7 +127,7 @@ static void ptn5150_irq_work(struct work_struct *work)case PTN5150_DFP_ATTACHED :extcon_set_state_sync (info->edev,EXTCON_USB_HOST , false); -gpiod_set_value (info->vbus_gpiod,0 ); +gpiod_set_value_cansleep (info->vbus_gpiod,0 );extcon_set_state_sync (info->edev,EXTCON_USB , true);break ;
@@ -138,9 +138,9 @@ static void ptn5150_irq_work(struct work_struct *work) PTN5150_REG_CC_VBUS_DETECTION_MASK) >> PTN5150_REG_CC_VBUS_DETECTION_SHIFT);if (vbus) -gpiod_set_value (info->vbus_gpiod,0 ); +gpiod_set_value_cansleep (info->vbus_gpiod,0 );else -gpiod_set_value (info->vbus_gpiod,1 ); +gpiod_set_value_cansleep (info->vbus_gpiod,1 );extcon_set_state_sync (info->edev,EXTCON_USB_HOST , true);
@@ -156,7 +156,7 @@ static void ptn5150_irq_work(struct work_struct *work) EXTCON_USB_HOST, false);extcon_set_state_sync (info->edev,EXTCON_USB , false); -gpiod_set_value (info->vbus_gpiod,0 ); +gpiod_set_value_cansleep (info->vbus_gpiod,0 ); } }
Signature · 1 line
2.17.1
Krzysztof Kozlowski
maintainerPATCH 5/11 extcon: ptn5150: Use generic "interrupts" property
In reply to Krzysztof KozlowskiInterrupts do not have to be always GPIO based so instead of expecting "int-gpios" property and converting the GPIO to an interrupt, just accept any interrupt via generic "interrupts" property.
Keep support for old "int-gpios" for backware compatibility.
--- drivers/extcon/extcon-ptn5150.c | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-)
drivers/extcon/extcon-ptn5150.c +18 -15
@@ -239,11 +239,6 @@ static int ptn5150_i2c_probe(struct i2c_client *i2c, info->dev = &i2c->dev; info->i2c = i2c; - info->int_gpiod =devm_gpiod_get (&i2c->dev,"int" ,GPIOD_IN ); -if (IS_ERR (info->int_gpiod)) { -dev_err (dev,"failed to get INT GPIO\n" ); -return PTR_ERR (info->int_gpiod); - } info->vbus_gpiod =devm_gpiod_get (&i2c->dev,"vbus" ,GPIOD_IN );if (IS_ERR (info->vbus_gpiod)) {dev_err (dev,"failed to get VBUS GPIO\n" );
@@ -267,22 +262,30 @@ static int ptn5150_i2c_probe(struct i2c_client *i2c,return ret; } -if (info->int_gpiod) { +if (i2c->irq >0 ) { + info->irq = i2c->irq; + }else { + info->int_gpiod =devm_gpiod_get (&i2c->dev,"int" ,GPIOD_IN ); +if (IS_ERR (info->int_gpiod)) { +dev_err (dev,"failed to get INT GPIO\n" ); +return PTR_ERR (info->int_gpiod); + } + info->irq =gpiod_to_irq (info->int_gpiod);if (info->irq <0 ) {dev_err (dev,"failed to get INTB IRQ\n" );return info->irq; } + } - ret =devm_request_threaded_irq (dev, info->irq,NULL , - ptn5150_irq_handler, -IRQF_TRIGGER_FALLING | -IRQF_ONESHOT , - i2c->name, info); -if (ret <0 ) { -dev_err (dev,"failed to request handler for INTB IRQ\n" ); -return ret; - } + ret =devm_request_threaded_irq (dev, info->irq,NULL , + ptn5150_irq_handler, +IRQF_TRIGGER_FALLING | +IRQF_ONESHOT , + i2c->name, info); +if (ret <0 ) { +dev_err (dev,"failed to request handler for INTB IRQ\n" ); +return ret; }/* Allocate extcon device */
Signature · 1 line
2.17.1
Krzysztof Kozlowski
maintainerPATCH 6/11 extcon: ptn5150: Simplify getting vbus-gpios with flags
In reply to Krzysztof KozlowskiInstead of obtaining GPIO as input and configuring it right after to output-low, just use proper GPIOD_OUT_LOW flag. Code is smaller and simpler.
--- drivers/extcon/extcon-ptn5150.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-)
drivers/extcon/extcon-ptn5150.c +1 -6
@@ -239,16 +239,11 @@ static int ptn5150_i2c_probe(struct i2c_client *i2c, info->dev = &i2c->dev; info->i2c = i2c; - info->vbus_gpiod =devm_gpiod_get (&i2c->dev,"vbus" ,GPIOD_IN ); + info->vbus_gpiod =devm_gpiod_get (&i2c->dev,"vbus" ,GPIOD_OUT_LOW );if (IS_ERR (info->vbus_gpiod)) {dev_err (dev,"failed to get VBUS GPIO\n" );return PTR_ERR (info->vbus_gpiod); } - ret =gpiod_direction_output (info->vbus_gpiod,0 ); -if (ret) { -dev_err (dev,"failed to set VBUS GPIO direction\n" ); -return -EINVAL ; - }mutex_init (&info->mutex);
Signature · 1 line
2.17.1
Krzysztof Kozlowski
maintainerPATCH 7/11 extcon: ptn5150: Lower the noisiness of probe
In reply to Krzysztof KozlowskiThe ptn5150 driver always prints device type on probe but as raw hex, without any translation to meaningful description. This is useful only for board bring up time so lower the verbosity to debug.
--- drivers/extcon/extcon-ptn5150.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/extcon/extcon-ptn5150.c +2 -2
@@ -199,8 +199,8 @@ static int ptn5150_init_dev_type(struct ptn5150_info *info) version_id = ((reg_data &PTN5150_REG_DEVICE_ID_VERSION_MASK ) >>PTN5150_REG_DEVICE_ID_VERSION_SHIFT ); -dev_info (info->dev,"Device type: version: 0x%x, vendor: 0x%x\n" , - version_id, vendor_id); +dev_dbg (info->dev,"Device type: version: 0x%x, vendor: 0x%x\n" , + version_id, vendor_id);/* Clear any existing interrupts */ ret =regmap_read (info->regmap,PTN5150_REG_INT_STATUS , ®_data);
Signature · 1 line
2.17.1
Krzysztof Kozlowski
maintainerPATCH 8/11 extcon: ptn5150: Check current USB mode when probing
In reply to Krzysztof KozlowskiWhen machine boots up, the USB could be already in OTG mode. In such case there will be no interrupt coming to ptn5150 device and driver will report default state of nothing connected. Detection of USB connection would happen on first unplug of the cable.
Factor out code for checking current connection mode and call it right after probe so the existing USB mode will be properly reported.
--- drivers/extcon/extcon-ptn5150.c | 93 ++++++++++++++++++--------------- 1 file changed, 50 insertions(+), 43 deletions(-)
drivers/extcon/extcon-ptn5150.c +50 -43
@@ -5,6 +5,7 @@// Based on extcon-sm5502.c driver // Copyright (c) 2018-2019 by Vijai Kumar K // Author: Vijai Kumar K <[email protected]> +// Copyright (c) 2020 Krzysztof Kozlowski <[email protected]> #include <linux/err.h> #include <linux/i2c.h>
@@ -83,12 +84,50 @@ static const struct regmap_config ptn5150_regmap_config = { .max_register = PTN5150_REG_END, }; +static void ptn5150_check_state (struct ptn5150_info *info) +{ +unsigned int port_status, reg_data, vbus; +int ret; + + ret =regmap_read (info->regmap,PTN5150_REG_CC_STATUS , ®_data); +if (ret) { +dev_err (info->dev,"failed to read CC STATUS %d\n" , ret); +mutex_unlock (&info->mutex); +return ; + } + + port_status = ((reg_data & +PTN5150_REG_CC_PORT_ATTACHMENT_MASK ) >> +PTN5150_REG_CC_PORT_ATTACHMENT_SHIFT ); + +switch (port_status) { +case PTN5150_DFP_ATTACHED : +extcon_set_state_sync (info->edev,EXTCON_USB_HOST , false); +gpiod_set_value_cansleep (info->vbus_gpiod,0 ); +extcon_set_state_sync (info->edev,EXTCON_USB , true); +break ; +case PTN5150_UFP_ATTACHED : +extcon_set_state_sync (info->edev,EXTCON_USB , false); + vbus = ((reg_data &PTN5150_REG_CC_VBUS_DETECTION_MASK ) >> +PTN5150_REG_CC_VBUS_DETECTION_SHIFT ); +if (vbus) +gpiod_set_value_cansleep (info->vbus_gpiod,0 ); +else +gpiod_set_value_cansleep (info->vbus_gpiod,1 ); + +extcon_set_state_sync (info->edev,EXTCON_USB_HOST , true); +break ; +default : +dev_err (info->dev,"Unknown Port status : %x\n" , port_status); +break ; + } +} +static void ptn5150_irq_work (struct work_struct *work) {struct ptn5150_info *info =container_of (work, struct ptn5150_info, irq_work);int ret =0 ; -unsigned int reg_data;unsigned int int_status;if (!info->edev)
@@ -96,13 +135,6 @@ static void ptn5150_irq_work(struct work_struct *work)mutex_lock (&info->mutex); - ret =regmap_read (info->regmap,PTN5150_REG_CC_STATUS , ®_data); -if (ret) { -dev_err (info->dev,"failed to read CC STATUS %d\n" , ret); -mutex_unlock (&info->mutex); -return ; - } -/* Clear interrupt. Read would clear the register */ ret =regmap_read (info->regmap,PTN5150_REG_INT_STATUS , &int_status);if (ret) {
@@ -116,41 +148,7 @@ static void ptn5150_irq_work(struct work_struct *work) cable_attach = int_status &PTN5150_REG_INT_CABLE_ATTACH_MASK ;if (cable_attach) { -unsigned int port_status; -unsigned int vbus; - - port_status = ((reg_data & -PTN5150_REG_CC_PORT_ATTACHMENT_MASK ) >> -PTN5150_REG_CC_PORT_ATTACHMENT_SHIFT ); - -switch (port_status) { -case PTN5150_DFP_ATTACHED : -extcon_set_state_sync (info->edev, -EXTCON_USB_HOST , false); -gpiod_set_value_cansleep (info->vbus_gpiod,0 ); -extcon_set_state_sync (info->edev,EXTCON_USB , - true); -break ; -case PTN5150_UFP_ATTACHED : -extcon_set_state_sync (info->edev,EXTCON_USB , - false); - vbus = ((reg_data & -PTN5150_REG_CC_VBUS_DETECTION_MASK ) >> -PTN5150_REG_CC_VBUS_DETECTION_SHIFT ); -if (vbus) -gpiod_set_value_cansleep (info->vbus_gpiod,0 ); -else -gpiod_set_value_cansleep (info->vbus_gpiod,1 ); - -extcon_set_state_sync (info->edev, -EXTCON_USB_HOST , true); -break ; -default : -dev_err (info->dev, -"Unknown Port status : %x\n" , - port_status); -break ; - } +ptn5150_check_state (info); }else {extcon_set_state_sync (info->edev,EXTCON_USB_HOST , false);
@@ -302,6 +300,14 @@ static int ptn5150_i2c_probe(struct i2c_client *i2c,if (ret)return -EINVAL ; +/* +* Update current extcon state if for example OTG connection was there +* before the probe +*/ +mutex_lock (&info->mutex); +ptn5150_check_state (info); +mutex_unlock (&info->mutex); +return 0 ; }
@@ -334,4 +340,5 @@ subsys_initcall(ptn5150_i2c_init);MODULE_DESCRIPTION ("NXP PTN5150 CC logic Extcon driver" );MODULE_AUTHOR ("Vijai Kumar K <[email protected]>" ); +MODULE_AUTHOR ("Krzysztof Kozlowski <[email protected]>" );MODULE_LICENSE ("GPL v2" );
Signature · 1 line
2.17.1
Krzysztof Kozlowski
maintainerRe: [PATCH 08/11] extcon: ptn5150: Check current USB mode when probing
Quoted 28 lines · Krzysztof Kozlowski
When machine boots up, the USB could be already in OTG mode. In such case there will be no interrupt coming to ptn5150 device and driver will report default state of nothing connected. Detection of USB connection would happen on first unplug of the cable.
Factor out code for checking current connection mode and call it right after probe so the existing USB mode will be properly reported.
Signed-off-by Krzysztof Kozlowski <[email protected]>--- drivers/extcon/extcon-ptn5150.c | 93 ++++++++++++++++++--------------- 1 file changed, 50 insertions(+), 43 deletions(-)drivers/extcon/extcon-ptn5150.c +1
-0@@ -5,6 +5,7 @@// Based on extcon-sm5502.c driver // Copyright (c) 2018-2019 by Vijai Kumar K // Author: Vijai Kumar K <[email protected]> +// Copyright (c) 2020 Krzysztof Kozlowski <[email protected]> #include <linux/err.h> #include <linux/i2c.h> @@ -83,12 +84,50 @@ static const struct regmap_config ptn5150_regmap_config = { .max_register = PTN5150_REG_END, };
drivers/extcon/extcon-ptn5150.c static const struct regmap_config ptn5150_regmap_config = { · line 95
Quoted 10 lines
drivers/extcon/extcon-ptn5150.c +9
-0+static void ptn5150_check_state (struct ptn5150_info *info) +{ +unsigned int port_status, reg_data, vbus; +int ret; + + ret =regmap_read (info->regmap,PTN5150_REG_CC_STATUS , ®_data); +if (ret) { +dev_err (info->dev,"failed to read CC STATUS %d\n" , ret); +mutex_unlock (&info->mutex);
There is a double mutex unlock here, I'll send a v2.
Best regards,
Krzysztof
Krzysztof Kozlowski
maintainerPATCH 9/11 extcon: ptn5150: Make 'vbus-gpios' optional
In reply to Krzysztof KozlowskiThe PTN5150 chip can be used in hardware designs with only reporting of USB Type-C connection, without the VBUS control. The driver however unconditionally expected 'vbus-gpios'.
Since all uses of the VBUS GPIO descriptor are NULL safe, the code can accept missing GPIO and provide only extcon status reporting.
--- drivers/extcon/extcon-ptn5150.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/extcon/extcon-ptn5150.c +8 -2
@@ -239,8 +239,14 @@ static int ptn5150_i2c_probe(struct i2c_client *i2c, info->i2c = i2c; info->vbus_gpiod =devm_gpiod_get (&i2c->dev,"vbus" ,GPIOD_OUT_LOW );if (IS_ERR (info->vbus_gpiod)) { -dev_err (dev,"failed to get VBUS GPIO\n" ); -return PTR_ERR (info->vbus_gpiod); + ret =PTR_ERR (info->vbus_gpiod); +if (ret == -ENOENT ) { +dev_info (dev,"No VBUS GPIO, ignoring VBUS control\n" ); + info->vbus_gpiod =NULL ; + }else { +dev_err (dev,"failed to get VBUS GPIO\n" ); +return ret; + } }mutex_init (&info->mutex);
Signature · 1 line
2.17.1
Krzysztof Kozlowski
maintainerPATCH 10/11 extcon: ptn5150: Reduce the amount of logs on deferred probe
In reply to Krzysztof KozlowskiThere is no point to print deferred probe (and its failures to get resources) as an error. In case of multiple probe tries this would pollute the dmesg.
--- drivers/extcon/extcon-ptn5150.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
drivers/extcon/extcon-ptn5150.c +6 -5
@@ -244,7 +244,7 @@ static int ptn5150_i2c_probe(struct i2c_client *i2c,dev_info (dev,"No VBUS GPIO, ignoring VBUS control\n" ); info->vbus_gpiod =NULL ; }else { -dev_err (dev,"failed to get VBUS GPIO\n" ); +dev_err_probe (dev, ret,"failed to get VBUS GPIO\n" );return ret; } }
@@ -256,8 +256,8 @@ static int ptn5150_i2c_probe(struct i2c_client *i2c, info->regmap =devm_regmap_init_i2c (i2c, &ptn5150_regmap_config);if (IS_ERR (info->regmap)) { ret =PTR_ERR (info->regmap); -dev_err (info->dev,"failed to allocate register map: %d\n" , - ret); +dev_err_probe (info->dev, ret,"failed to allocate register map: %d\n" , + ret);return ret; }
@@ -266,8 +266,9 @@ static int ptn5150_i2c_probe(struct i2c_client *i2c, }else { info->int_gpiod =devm_gpiod_get (&i2c->dev,"int" ,GPIOD_IN );if (IS_ERR (info->int_gpiod)) { -dev_err (dev,"failed to get INT GPIO\n" ); -return PTR_ERR (info->int_gpiod); + ret =PTR_ERR (info->int_gpiod); +dev_err_probe (dev, ret,"failed to get INT GPIO\n" ); +return ret; } info->irq =gpiod_to_irq (info->int_gpiod);
Signature · 1 line
2.17.1
Krzysztof Kozlowski
maintainerPATCH 11/11 MAINTAINERS: Add entry for NXP PTN5150A CC driver
In reply to Krzysztof KozlowskiAdd Krzysztof Kozlowski as maintainer of NXP PTN5150A CC/extcon driver to provide review, feedback and testing.
--- MAINTAINERS | 7 +++++++ 1 file changed, 7 insertions(+)
MAINTAINERS +7 -0
@@ -12431,6 +12431,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)
Signature · 1 line
2.17.1
Krzysztof Kozlowski
maintainerPATCH 12/13 extcon: ptn5150: Convert to module_i2c_driver
In reply to Krzysztof KozlowskiUse module_i2c_driver() to simplify driver init boilerplate.
--- drivers/extcon/extcon-ptn5150.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-)
drivers/extcon/extcon-ptn5150.c +1 -6
@@ -338,12 +338,7 @@ static struct i2c_driver ptn5150_i2c_driver = { .probe = ptn5150_i2c_probe, .id_table = ptn5150_i2c_id, }; - -static int __init ptn5150_i2c_init (void ) -{ -return i2c_add_driver (&ptn5150_i2c_driver); -} -subsys_initcall (ptn5150_i2c_init); +module_i2c_driver (ptn5150_i2c_driver);MODULE_DESCRIPTION ("NXP PTN5150 CC logic Extcon driver" );MODULE_AUTHOR ("Vijai Kumar K <[email protected]>" );
Signature · 1 line
2.17.1
Krzysztof Kozlowski
maintainerPATCH 13/13 extcon: ptn5150: Convert to .probe_new
The 'struct i2c_device_id' argument of probe function is not used, so convert the driver to simpler 'probe_new' interface.
--- drivers/extcon/extcon-ptn5150.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/extcon/extcon-ptn5150.c +2 -3
@@ -219,8 +219,7 @@ static int ptn5150_init_dev_type(struct ptn5150_info *info)return 0 ; } -static int ptn5150_i2c_probe (struct i2c_client *i2c, -const struct i2c_device_id *id) +static int ptn5150_i2c_probe (struct i2c_client *i2c) {struct device *dev = &i2c->dev;struct device_node *np = i2c->dev.of_node;
@@ -335,7 +334,7 @@ static struct i2c_driver ptn5150_i2c_driver = { .name = "ptn5150", .of_match_table = ptn5150_dt_match, }, - .probe = ptn5150_i2c_probe, + .probe_new = ptn5150_i2c_probe, .id_table = ptn5150_i2c_id, };module_i2c_driver (ptn5150_i2c_driver);
Signature · 1 line
2.17.1