* [PATCH v1 1/2] mfd: intel_quark_i2c_gpio: Convert I²C to use software nodes [not found] <20210331154851.8456-1-andriy.shevchenko@linux.intel.com> @ 2021-03-31 15:48 ` Andy Shevchenko 2021-04-06 8:36 ` Lee Jones 2021-04-14 8:33 ` Lee Jones 2021-03-31 15:48 ` [PATCH v1 2/2] i2c: designware: Get rid of legacy platform data Andy Shevchenko ` (2 subsequent siblings) 3 siblings, 2 replies; 12+ messages in thread From: Andy Shevchenko @ 2021-03-31 15:48 UTC (permalink / raw) To: Wolfram Sang, Andy Shevchenko, Serge Semin, Lee Jones, linux-kernel, linux-i2c Cc: Jarkko Nikula, Mika Westerberg The driver can provide a software node group instead of passing legacy platform data. This will allow to drop the legacy platform data structures along with unifying a child device driver to use same interface for all property providers, i.e. Device Tree, ACPI, and board files. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> --- drivers/mfd/intel_quark_i2c_gpio.c | 41 +++++++++++++++++++----------- 1 file changed, 26 insertions(+), 15 deletions(-) diff --git a/drivers/mfd/intel_quark_i2c_gpio.c b/drivers/mfd/intel_quark_i2c_gpio.c index 9a5f84b93776..a43993e38b6e 100644 --- a/drivers/mfd/intel_quark_i2c_gpio.c +++ b/drivers/mfd/intel_quark_i2c_gpio.c @@ -18,7 +18,7 @@ #include <linux/dmi.h> #include <linux/i2c.h> #include <linux/platform_data/gpio-dwapb.h> -#include <linux/platform_data/i2c-designware.h> +#include <linux/property.h> /* PCI BAR for register base address */ #define MFD_I2C_BAR 0 @@ -50,24 +50,44 @@ struct intel_quark_mfd { struct clk_lookup *i2c_clk_lookup; }; +static const struct property_entry intel_quark_i2c_controller_standard_properties[] = { + PROPERTY_ENTRY_U32("clock-frequency", I2C_MAX_STANDARD_MODE_FREQ), + { } +}; + +static const struct software_node intel_quark_i2c_controller_standard_node = { + .name = "intel-quark-i2c-controller", + .properties = intel_quark_i2c_controller_standard_properties, +}; + +static const struct property_entry intel_quark_i2c_controller_fast_properties[] = { + PROPERTY_ENTRY_U32("clock-frequency", I2C_MAX_FAST_MODE_FREQ), + { } +}; + +static const struct software_node intel_quark_i2c_controller_fast_node = { + .name = "intel-quark-i2c-controller", + .properties = intel_quark_i2c_controller_fast_properties, +}; + static const struct dmi_system_id dmi_platform_info[] = { { .matches = { DMI_EXACT_MATCH(DMI_BOARD_NAME, "Galileo"), }, - .driver_data = (void *)I2C_MAX_STANDARD_MODE_FREQ, + .driver_data = (void *)&intel_quark_i2c_controller_standard_node, }, { .matches = { DMI_EXACT_MATCH(DMI_BOARD_NAME, "GalileoGen2"), }, - .driver_data = (void *)I2C_MAX_FAST_MODE_FREQ, + .driver_data = (void *)&intel_quark_i2c_controller_fast_node, }, { .matches = { DMI_EXACT_MATCH(DMI_BOARD_NAME, "SIMATIC IOT2000"), }, - .driver_data = (void *)I2C_MAX_FAST_MODE_FREQ, + .driver_data = (void *)&intel_quark_i2c_controller_fast_node, }, {} }; @@ -162,8 +182,6 @@ static int intel_quark_i2c_setup(struct pci_dev *pdev) struct mfd_cell *cell = &intel_quark_mfd_cells[MFD_I2C_BAR]; struct resource *res = intel_quark_i2c_res; const struct dmi_system_id *dmi_id; - struct dw_i2c_platform_data *pdata; - struct device *dev = &pdev->dev; res[INTEL_QUARK_IORES_MEM].start = pci_resource_start(pdev, MFD_I2C_BAR); res[INTEL_QUARK_IORES_MEM].end = pci_resource_end(pdev, MFD_I2C_BAR); @@ -171,19 +189,12 @@ static int intel_quark_i2c_setup(struct pci_dev *pdev) res[INTEL_QUARK_IORES_IRQ].start = pci_irq_vector(pdev, 0); res[INTEL_QUARK_IORES_IRQ].end = pci_irq_vector(pdev, 0); - pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL); - if (!pdata) - return -ENOMEM; - /* Normal mode by default */ - pdata->i2c_scl_freq = I2C_MAX_STANDARD_MODE_FREQ; + cell->swnode = &intel_quark_i2c_controller_standard_node; dmi_id = dmi_first_match(dmi_platform_info); if (dmi_id) - pdata->i2c_scl_freq = (uintptr_t)dmi_id->driver_data; - - cell->platform_data = pdata; - cell->pdata_size = sizeof(*pdata); + cell->swnode = (struct software_node *)dmi_id->driver_data; return 0; } -- 2.30.2 ^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH v1 1/2] mfd: intel_quark_i2c_gpio: Convert I²C to use software nodes 2021-03-31 15:48 ` [PATCH v1 1/2] mfd: intel_quark_i2c_gpio: Convert I²C to use software nodes Andy Shevchenko @ 2021-04-06 8:36 ` Lee Jones 2021-04-14 8:33 ` Lee Jones 1 sibling, 0 replies; 12+ messages in thread From: Lee Jones @ 2021-04-06 8:36 UTC (permalink / raw) To: Andy Shevchenko Cc: Wolfram Sang, Serge Semin, linux-kernel, linux-i2c, Jarkko Nikula, Mika Westerberg On Wed, 31 Mar 2021, Andy Shevchenko wrote: > The driver can provide a software node group instead of > passing legacy platform data. This will allow to drop > the legacy platform data structures along with unifying > a child device driver to use same interface for all > property providers, i.e. Device Tree, ACPI, and board files. > > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> > --- > drivers/mfd/intel_quark_i2c_gpio.c | 41 +++++++++++++++++++----------- > 1 file changed, 26 insertions(+), 15 deletions(-) For my own reference (apply this as-is to your sign-off block): Acked-for-MFD-by: Lee Jones <lee.jones@linaro.org> -- Lee Jones [李琼斯] Senior Technical Lead - Developer Services Linaro.org │ Open source software for Arm SoCs Follow Linaro: Facebook | Twitter | Blog ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v1 1/2] mfd: intel_quark_i2c_gpio: Convert I²C to use software nodes 2021-03-31 15:48 ` [PATCH v1 1/2] mfd: intel_quark_i2c_gpio: Convert I²C to use software nodes Andy Shevchenko 2021-04-06 8:36 ` Lee Jones @ 2021-04-14 8:33 ` Lee Jones 1 sibling, 0 replies; 12+ messages in thread From: Lee Jones @ 2021-04-14 8:33 UTC (permalink / raw) To: Andy Shevchenko Cc: Wolfram Sang, Serge Semin, linux-kernel, linux-i2c, Jarkko Nikula, Mika Westerberg On Wed, 31 Mar 2021, Andy Shevchenko wrote: > The driver can provide a software node group instead of > passing legacy platform data. This will allow to drop > the legacy platform data structures along with unifying > a child device driver to use same interface for all > property providers, i.e. Device Tree, ACPI, and board files. > > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> > --- > drivers/mfd/intel_quark_i2c_gpio.c | 41 +++++++++++++++++++----------- > 1 file changed, 26 insertions(+), 15 deletions(-) Applied, thanks. -- Lee Jones [李琼斯] Senior Technical Lead - Developer Services Linaro.org │ Open source software for Arm SoCs Follow Linaro: Facebook | Twitter | Blog ^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH v1 2/2] i2c: designware: Get rid of legacy platform data [not found] <20210331154851.8456-1-andriy.shevchenko@linux.intel.com> 2021-03-31 15:48 ` [PATCH v1 1/2] mfd: intel_quark_i2c_gpio: Convert I²C to use software nodes Andy Shevchenko @ 2021-03-31 15:48 ` Andy Shevchenko 2021-04-06 10:49 ` Wolfram Sang 2021-04-14 8:33 ` Lee Jones 2021-04-05 20:59 ` [PATCH v1 0/2] mfd: intel_quark_i2c_gpio: Covert I²C part to software nodes Wolfram Sang 2021-04-13 16:06 ` Andy Shevchenko 3 siblings, 2 replies; 12+ messages in thread From: Andy Shevchenko @ 2021-03-31 15:48 UTC (permalink / raw) To: Wolfram Sang, Andy Shevchenko, Serge Semin, Lee Jones, linux-kernel, linux-i2c Cc: Jarkko Nikula, Mika Westerberg Platform data is a legacy interface to supply device properties to the driver. In this case we don't have anymore in-kernel users for it. Just remove it for good. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> --- drivers/i2c/busses/i2c-designware-platdrv.c | 7 +------ include/linux/platform_data/i2c-designware.h | 13 ------------- 2 files changed, 1 insertion(+), 19 deletions(-) delete mode 100644 include/linux/platform_data/i2c-designware.h diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c index 0dfeb2d11603..4b37f28ec0c6 100644 --- a/drivers/i2c/busses/i2c-designware-platdrv.c +++ b/drivers/i2c/busses/i2c-designware-platdrv.c @@ -22,7 +22,6 @@ #include <linux/mfd/syscon.h> #include <linux/module.h> #include <linux/of.h> -#include <linux/platform_data/i2c-designware.h> #include <linux/platform_device.h> #include <linux/pm.h> #include <linux/pm_runtime.h> @@ -206,7 +205,6 @@ static const struct dmi_system_id dw_i2c_hwmon_class_dmi[] = { static int dw_i2c_plat_probe(struct platform_device *pdev) { - struct dw_i2c_platform_data *pdata = dev_get_platdata(&pdev->dev); struct i2c_adapter *adap; struct dw_i2c_dev *dev; struct i2c_timings *t; @@ -236,10 +234,7 @@ static int dw_i2c_plat_probe(struct platform_device *pdev) reset_control_deassert(dev->rst); t = &dev->timings; - if (pdata) - t->bus_freq_hz = pdata->i2c_scl_freq; - else - i2c_parse_fw_timings(&pdev->dev, t, false); + i2c_parse_fw_timings(&pdev->dev, t, false); i2c_dw_adjust_bus_speed(dev); diff --git a/include/linux/platform_data/i2c-designware.h b/include/linux/platform_data/i2c-designware.h deleted file mode 100644 index 014c4a5a7e13..000000000000 --- a/include/linux/platform_data/i2c-designware.h +++ /dev/null @@ -1,13 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -/* - * Copyright(c) 2014 Intel Corporation. - */ - -#ifndef I2C_DESIGNWARE_H -#define I2C_DESIGNWARE_H - -struct dw_i2c_platform_data { - unsigned int i2c_scl_freq; -}; - -#endif -- 2.30.2 ^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH v1 2/2] i2c: designware: Get rid of legacy platform data 2021-03-31 15:48 ` [PATCH v1 2/2] i2c: designware: Get rid of legacy platform data Andy Shevchenko @ 2021-04-06 10:49 ` Wolfram Sang 2021-04-06 11:27 ` Jarkko Nikula 2021-04-14 8:14 ` Lee Jones 2021-04-14 8:33 ` Lee Jones 1 sibling, 2 replies; 12+ messages in thread From: Wolfram Sang @ 2021-04-06 10:49 UTC (permalink / raw) To: Andy Shevchenko Cc: Serge Semin, Lee Jones, linux-kernel, linux-i2c, Jarkko Nikula, Mika Westerberg [-- Attachment #1: Type: text/plain, Size: 357 bytes --] On Wed, Mar 31, 2021 at 06:48:51PM +0300, Andy Shevchenko wrote: > Platform data is a legacy interface to supply device properties > to the driver. In this case we don't have anymore in-kernel users > for it. Just remove it for good. > > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Wolfram Sang <wsa@kernel.org> [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 833 bytes --] ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v1 2/2] i2c: designware: Get rid of legacy platform data 2021-04-06 10:49 ` Wolfram Sang @ 2021-04-06 11:27 ` Jarkko Nikula 2021-04-14 8:14 ` Lee Jones 1 sibling, 0 replies; 12+ messages in thread From: Jarkko Nikula @ 2021-04-06 11:27 UTC (permalink / raw) To: Wolfram Sang, Andy Shevchenko Cc: Serge Semin, Lee Jones, linux-kernel, linux-i2c, Mika Westerberg On 4/6/21 1:49 PM, Wolfram Sang wrote: > On Wed, Mar 31, 2021 at 06:48:51PM +0300, Andy Shevchenko wrote: >> Platform data is a legacy interface to supply device properties >> to the driver. In this case we don't have anymore in-kernel users >> for it. Just remove it for good. >> >> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> > > Acked-by: Wolfram Sang <wsa@kernel.org> > Acked-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v1 2/2] i2c: designware: Get rid of legacy platform data 2021-04-06 10:49 ` Wolfram Sang 2021-04-06 11:27 ` Jarkko Nikula @ 2021-04-14 8:14 ` Lee Jones 2021-04-14 8:15 ` Wolfram Sang 1 sibling, 1 reply; 12+ messages in thread From: Lee Jones @ 2021-04-14 8:14 UTC (permalink / raw) To: Wolfram Sang Cc: Andy Shevchenko, Serge Semin, linux-kernel, linux-i2c, Jarkko Nikula, Mika Westerberg On Tue, 06 Apr 2021, Wolfram Sang wrote: > On Wed, Mar 31, 2021 at 06:48:51PM +0300, Andy Shevchenko wrote: > > Platform data is a legacy interface to supply device properties > > to the driver. In this case we don't have anymore in-kernel users > > for it. Just remove it for good. > > > > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> > > Acked-by: Wolfram Sang <wsa@kernel.org> Do you require an immutable branch? -- Lee Jones [李琼斯] Senior Technical Lead - Developer Services Linaro.org │ Open source software for Arm SoCs Follow Linaro: Facebook | Twitter | Blog ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v1 2/2] i2c: designware: Get rid of legacy platform data 2021-04-14 8:14 ` Lee Jones @ 2021-04-14 8:15 ` Wolfram Sang 0 siblings, 0 replies; 12+ messages in thread From: Wolfram Sang @ 2021-04-14 8:15 UTC (permalink / raw) To: Lee Jones Cc: Andy Shevchenko, Serge Semin, linux-kernel, linux-i2c, Jarkko Nikula, Mika Westerberg [-- Attachment #1: Type: text/plain, Size: 396 bytes --] > > > Platform data is a legacy interface to supply device properties > > > to the driver. In this case we don't have anymore in-kernel users > > > for it. Just remove it for good. > > > > > > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> > > > > Acked-by: Wolfram Sang <wsa@kernel.org> > > Do you require an immutable branch? Nope, but thanks for asking. [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 833 bytes --] ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v1 2/2] i2c: designware: Get rid of legacy platform data 2021-03-31 15:48 ` [PATCH v1 2/2] i2c: designware: Get rid of legacy platform data Andy Shevchenko 2021-04-06 10:49 ` Wolfram Sang @ 2021-04-14 8:33 ` Lee Jones 1 sibling, 0 replies; 12+ messages in thread From: Lee Jones @ 2021-04-14 8:33 UTC (permalink / raw) To: Andy Shevchenko Cc: Wolfram Sang, Serge Semin, linux-kernel, linux-i2c, Jarkko Nikula, Mika Westerberg On Wed, 31 Mar 2021, Andy Shevchenko wrote: > Platform data is a legacy interface to supply device properties > to the driver. In this case we don't have anymore in-kernel users > for it. Just remove it for good. > > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> > --- > drivers/i2c/busses/i2c-designware-platdrv.c | 7 +------ > include/linux/platform_data/i2c-designware.h | 13 ------------- > 2 files changed, 1 insertion(+), 19 deletions(-) > delete mode 100644 include/linux/platform_data/i2c-designware.h Applied, thanks. -- Lee Jones [李琼斯] Senior Technical Lead - Developer Services Linaro.org │ Open source software for Arm SoCs Follow Linaro: Facebook | Twitter | Blog ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v1 0/2] mfd: intel_quark_i2c_gpio: Covert I²C part to software nodes [not found] <20210331154851.8456-1-andriy.shevchenko@linux.intel.com> 2021-03-31 15:48 ` [PATCH v1 1/2] mfd: intel_quark_i2c_gpio: Convert I²C to use software nodes Andy Shevchenko 2021-03-31 15:48 ` [PATCH v1 2/2] i2c: designware: Get rid of legacy platform data Andy Shevchenko @ 2021-04-05 20:59 ` Wolfram Sang 2021-04-06 10:38 ` Andy Shevchenko 2021-04-13 16:06 ` Andy Shevchenko 3 siblings, 1 reply; 12+ messages in thread From: Wolfram Sang @ 2021-04-05 20:59 UTC (permalink / raw) To: Andy Shevchenko Cc: Serge Semin, Lee Jones, linux-kernel, linux-i2c, Jarkko Nikula, Mika Westerberg [-- Attachment #1: Type: text/plain, Size: 182 bytes --] > driver). In any case I guess the procedure is pretty much standard, i.e. Lee > creates an immutable branch that Wolfram can pull into his tree. Yes, that would be my favourite. [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 833 bytes --] ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v1 0/2] mfd: intel_quark_i2c_gpio: Covert I²C part to software nodes 2021-04-05 20:59 ` [PATCH v1 0/2] mfd: intel_quark_i2c_gpio: Covert I²C part to software nodes Wolfram Sang @ 2021-04-06 10:38 ` Andy Shevchenko 0 siblings, 0 replies; 12+ messages in thread From: Andy Shevchenko @ 2021-04-06 10:38 UTC (permalink / raw) To: Wolfram Sang, Serge Semin, Lee Jones, linux-kernel, linux-i2c, Jarkko Nikula, Mika Westerberg On Mon, Apr 05, 2021 at 10:59:28PM +0200, Wolfram Sang wrote: > > > driver). In any case I guess the procedure is pretty much standard, i.e. Lee > > creates an immutable branch that Wolfram can pull into his tree. > > Yes, that would be my favourite. Can you Ack the patch then? -- With Best Regards, Andy Shevchenko ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v1 0/2] mfd: intel_quark_i2c_gpio: Covert I²C part to software nodes [not found] <20210331154851.8456-1-andriy.shevchenko@linux.intel.com> ` (2 preceding siblings ...) 2021-04-05 20:59 ` [PATCH v1 0/2] mfd: intel_quark_i2c_gpio: Covert I²C part to software nodes Wolfram Sang @ 2021-04-13 16:06 ` Andy Shevchenko 3 siblings, 0 replies; 12+ messages in thread From: Andy Shevchenko @ 2021-04-13 16:06 UTC (permalink / raw) To: Wolfram Sang, Serge Semin, Lee Jones, linux-kernel, linux-i2c Cc: Jarkko Nikula, Mika Westerberg On Wed, Mar 31, 2021 at 06:48:49PM +0300, Andy Shevchenko wrote: > Since we have software nodes support in MFD core, we may start converting > intel_quark_i2c_gpio driver to use it. For the starter it converts I²C part. > and as a result we get rid of platform data for I²C DesignWare driver. > > This series depends on the stuff in MFD. OTOH the DesignWare patch should not > be in conflict with other patches floating around (against I²C DesignWare > driver). In any case I guess the procedure is pretty much standard, i.e. Lee > creates an immutable branch that Wolfram can pull into his tree. Lee, can you, please, apply this series? It seems we have all Acked by respective maintainer(s). > Andy Shevchenko (2): > mfd: intel_quark_i2c_gpio: Convert I²C to use software nodes > i2c: designware: Get rid of legacy platform data > > drivers/i2c/busses/i2c-designware-platdrv.c | 7 +--- > drivers/mfd/intel_quark_i2c_gpio.c | 41 +++++++++++++------- > include/linux/platform_data/i2c-designware.h | 13 ------- > 3 files changed, 27 insertions(+), 34 deletions(-) > delete mode 100644 include/linux/platform_data/i2c-designware.h > > -- > 2.30.2 > -- With Best Regards, Andy Shevchenko ^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2021-04-14 8:34 UTC | newest] Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- [not found] <20210331154851.8456-1-andriy.shevchenko@linux.intel.com> 2021-03-31 15:48 ` [PATCH v1 1/2] mfd: intel_quark_i2c_gpio: Convert I²C to use software nodes Andy Shevchenko 2021-04-06 8:36 ` Lee Jones 2021-04-14 8:33 ` Lee Jones 2021-03-31 15:48 ` [PATCH v1 2/2] i2c: designware: Get rid of legacy platform data Andy Shevchenko 2021-04-06 10:49 ` Wolfram Sang 2021-04-06 11:27 ` Jarkko Nikula 2021-04-14 8:14 ` Lee Jones 2021-04-14 8:15 ` Wolfram Sang 2021-04-14 8:33 ` Lee Jones 2021-04-05 20:59 ` [PATCH v1 0/2] mfd: intel_quark_i2c_gpio: Covert I²C part to software nodes Wolfram Sang 2021-04-06 10:38 ` Andy Shevchenko 2021-04-13 16:06 ` Andy Shevchenko
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).