Re: [PATCHv4 9/9] ASoC: dt-bindings: fsl-asoc-card: add compatible for generic codec

2024-05-20 Thread Rob Herring
On Wed, May 15, 2024 at 03:54:11PM +0200, Elinor Montmasson wrote:
> Add documentation about new dts bindings following new support
> for compatible "fsl,imx-audio-generic".
> 
> Some CPU DAI don't require a real audio codec. The new compatible
> "fsl,imx-audio-generic" allows using the driver with codec drivers
> SPDIF DIT and SPDIF DIR as dummy codecs.
> It also allows using not pre-configured audio codecs which
> don't require specific control through a codec driver.
> 
> The new dts properties give the possibility to set some parameters
> about the CPU DAI usually set through the codec configuration.
> 
> Signed-off-by: Elinor Montmasson 
> ---
>  .../bindings/sound/fsl-asoc-card.yaml | 96 ++-
>  1 file changed, 92 insertions(+), 4 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/sound/fsl-asoc-card.yaml 
> b/Documentation/devicetree/bindings/sound/fsl-asoc-card.yaml
> index 9922664d5ccc..332d8bf96e06 100644
> --- a/Documentation/devicetree/bindings/sound/fsl-asoc-card.yaml
> +++ b/Documentation/devicetree/bindings/sound/fsl-asoc-card.yaml
> @@ -23,6 +23,16 @@ description:
>and PCM DAI formats. However, it'll be also possible to support those non
>AC'97/I2S/PCM type sound cards, such as S/PDIF audio and HDMI audio, as
>long as the driver has been properly upgraded.
> +  To use CPU DAIs that do not require a codec such as an S/PDIF controller,
> +  or to use a DAI to output or capture raw I2S/TDM data, you can
> +  use the compatible "fsl,imx-audio-generic".
> +
> +definitions:
> +  imx-audio-generic-dependency:
> +properties:
> +  compatible:
> +contains:
> +  const: fsl,imx-audio-generic
>  
>  maintainers:
>- Shengjiu Wang 
> @@ -81,6 +91,7 @@ properties:
>- fsl,imx-audio-wm8960
>- fsl,imx-audio-wm8962
>- fsl,imx-audio-wm8958
> +  - fsl,imx-audio-generic
>  
>model:
>  $ref: /schemas/types.yaml#/definitions/string
> @@ -93,8 +104,14 @@ properties:
>need to add ASRC support via DPCM.
>  
>audio-codec:
> -$ref: /schemas/types.yaml#/definitions/phandle
> -description: The phandle of an audio codec
> +$ref: /schemas/types.yaml#/definitions/phandle-array
> +description: |
> +  The phandle of an audio codec.
> +  If using the "fsl,imx-audio-generic" compatible, give instead a pair of
> +  phandles with the spdif_transmitter first (driver SPDIF DIT) and the
> +  spdif_receiver second (driver SPDIF DIR).

   minItems: 1
   maxItems: 2

> +items:
> +  maxItems: 1
>  
>audio-cpu:
>  $ref: /schemas/types.yaml#/definitions/phandle
> @@ -150,8 +167,8 @@ properties:
>  description: dai-link uses bit clock inversion.
>  
>mclk-id:
> -$ref: /schemas/types.yaml#/definitions/uint32
> -description: main clock id, specific for each card configuration.
> +$ref: /schemas/types.yaml#/definitions/uint32-array
> +description: Main clock id for each codec, specific for each card 
> configuration.

   minItems: 1
   maxItems: 2
>  
>mux-int-port:
>  $ref: /schemas/types.yaml#/definitions/uint32
> @@ -167,10 +184,68 @@ properties:
>  $ref: /schemas/types.yaml#/definitions/phandle
>  description: The phandle of an CPU DAI controller
>  
> +  # Properties relevant only with "fsl,imx-audio-generic" compatible
> +  dai-tdm-slot-width:
> +description: See tdm-slot.txt.
> +$ref: /schemas/types.yaml#/definitions/uint32
> +
> +  dai-tdm-slot-num:
> +description: See tdm-slot.txt.
> +$ref: /schemas/types.yaml#/definitions/uint32
> +
> +  clocks:
> +description: |
> +  The CPU DAI system clock, used to retrieve
> +  the CPU DAI system clock frequency with the generic codec.
> +maxItems: 1
> +
> +  clock-names:
> +items:
> +  - const: cpu_sysclk
> +
> +  cpu-system-clock-direction-out:
> +description: |
> +  Specifies cpu system clock direction as 'out' on initialization.
> +  If not set, direction is 'in'.
> +$ref: /schemas/types.yaml#/definitions/flag
> +
> +dependencies:
> +  dai-tdm-slot-width:
> +$ref: "#/definitions/imx-audio-generic-dependency"
> +  dai-tdm-slot-num:
> +$ref: "#/definitions/imx-audio-generic-dependency"
> +  clocks:
> +$ref: "#/definitions/imx-audio-generic-dependency"
> +  cpu-system-clock-direction-out:
> +$ref: "#/definitions/imx-audio-generic-dependency"

This works, but is an unusual pattern...

> +
>  required:
>- compatible
>- model
>  
> +allOf:
> +  - if:
> +  $ref: "#/definitions/imx-audio-generic-dependency"
> +then:
> +  properties:
> +audio-codec:
> +  items:
> +- description: SPDIF DIT phandle
> +- description: SPDIF DIR phandle
> +mclk-id:
> +  maxItems: 1
> +  items:
> +minItems: 1
> +maxItems: 2
> +else:
> +  properties:
> +audio-codec:
> +   

Re: [PATCH v2 1/2] ASoC: dt-bindings: fsl,xcvr: Add compatible string for i.MX95

2024-05-20 Thread Rob Herring
On Tue, May 14, 2024 at 11:12:08AM +0800, Shengjiu Wang wrote:
> Add compatible string "fsl,imx95-xcvr" for i.MX95 platform.
> 
> The difference between each platform is in below table.
> 
> +-++--++
> |  SOC  |  PHY   | eARC/ARC | SPDIF  |
> +-++--++
> | i.MX8MP |  V1|  Yes |  Yes   |
> +-++--++
> | i.MX93  |  N/A   |  N/A |  Yes   |
> +-++--++
> | i.MX95  |  V2|  N/A |  Yes   |
> +-++--++
> 
> On i.MX95, there are two PLL clock sources, they are the parent
> clocks of the XCVR root clock. one is for 8kHz series rates, named
> as 'pll8k', another one is for 11kHz series rates, named as 'pll11k'.
> They are optional clocks, if there are such clocks, then the driver
> can switch between them to support more accurate sample rates.
> 
> As 'pll8k' and 'pll11k' are optional, then add 'minItems: 4'
> for clocks and clock-names properties.
> 
> Signed-off-by: Shengjiu Wang 
> ---
>  .../devicetree/bindings/sound/fsl,xcvr.yaml   | 55 +++
>  1 file changed, 45 insertions(+), 10 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/sound/fsl,xcvr.yaml 
> b/Documentation/devicetree/bindings/sound/fsl,xcvr.yaml
> index 0eb0c1ba8710..70bcde33e986 100644
> --- a/Documentation/devicetree/bindings/sound/fsl,xcvr.yaml
> +++ b/Documentation/devicetree/bindings/sound/fsl,xcvr.yaml
> @@ -22,6 +22,7 @@ properties:
>  enum:
>- fsl,imx8mp-xcvr
>- fsl,imx93-xcvr
> +  - fsl,imx95-xcvr
>  
>reg:
>  items:
> @@ -44,18 +45,12 @@ properties:
>  minItems: 1
>  
>clocks:
> -items:
> -  - description: Peripheral clock
> -  - description: PHY clock
> -  - description: SPBA clock
> -  - description: PLL clock

Leave these here and add pll8k and pll11k.

> +minItems: 4

Keep this.

> +maxItems: 6
>  
>clock-names:
> -items:
> -  - const: ipg
> -  - const: phy
> -  - const: spba
> -  - const: pll_ipg
> +minItems: 4
> +maxItems: 6

Same here.

>  
>dmas:
>  items:
> @@ -97,6 +92,46 @@ allOf:
>properties:
>  interrupts:
>maxItems: 1
> +  - if:
> +  properties:
> +compatible:
> +  contains:
> +enum:
> +  - fsl,imx95-xcvr
> +then:
> +  properties:
> +clocks:
> +  items:
> +- description: Peripheral clock
> +- description: PHY clock
> +- description: SPBA clock
> +- description: PLL clock
> +- description: PLL clock source for 8kHz series
> +- description: PLL clock source for 11kHz series
> +  minItems: 4
> +clock-names:
> +  items:
> +- const: ipg
> +- const: phy
> +- const: spba
> +- const: pll_ipg
> +- const: pll8k
> +- const: pll11k
> +  minItems: 4

Drop all this.

> +else:
> +  properties:
> +clocks:
> +  items:
> +- description: Peripheral clock
> +- description: PHY clock
> +- description: SPBA clock
> +- description: PLL clock
> +clock-names:
> +  items:
> +- const: ipg
> +- const: phy
> +- const: spba
> +- const: pll_ipg

And for this case, you just need 'maxItems: 4'.

Rob


Re: [PATCH 0/7] Remove 40x

2024-05-06 Thread Rob Herring (Arm)


On Mon, 06 May 2024 22:51:45 +1000, Michael Ellerman wrote:
> The 40x platforms & CPUs are old and have been unmaintained for years, and as
> far as we can tell have no users.
> 
> Note 44x and 476 are not affected.
> 
> Christophe first proposed removing 40x in 2020:
>   
> https://lore.kernel.org/linuxppc-dev/40899eb1b8f10da3706acd06c3d46d2418c8886e.1585635837.git.christophe.le...@c-s.fr/
> 
> And on a few subsequent occasions.
> 
> The proposed removal was covered on Phronix:
>   https://www.phoronix.com/news/PowerPC-40x-400-Linux-Removal
> 
> OpenWRT dropped support in 2019.
> 
> So unless anyone steps up to maintain it, remove 40x as unused. RIP.
> 
> cheers
> 
> 
> More context: https://github.com/linuxppc/issues/issues/349
> 
> Christophe Leroy (4):
>   powerpc/40x: Remove 40x platforms.
>   powerpc/boot: Remove all 40x platforms from boot
>   powerpc: Remove core support for 40x
>   powerpc/platforms: Move files from 4xx to 44x
> 
> Michael Ellerman (3):
>   powerpc: Remove 40x from Kconfig and defconfig
>   powerpc/4xx: Remove CONFIG_BOOKE_OR_40x
>   powerpc: Replace CONFIG_4xx with CONFIG_44x
> 
>  MAINTAINERS   |   1 -
>  arch/powerpc/Kconfig  |  17 +-
>  arch/powerpc/Kconfig.debug|  13 -
>  arch/powerpc/Makefile |   5 -
>  arch/powerpc/boot/4xx.c   | 266 ---
>  arch/powerpc/boot/4xx.h   |   4 -
>  arch/powerpc/boot/Makefile|  11 -
>  arch/powerpc/boot/cuboot-acadia.c | 171 -
>  arch/powerpc/boot/cuboot-hotfoot.c| 139 
>  arch/powerpc/boot/cuboot-kilauea.c|  46 --
>  arch/powerpc/boot/dcr.h   |  11 -
>  arch/powerpc/boot/dts/acadia.dts  | 224 --
>  arch/powerpc/boot/dts/hotfoot.dts | 296 ---
>  arch/powerpc/boot/dts/kilauea.dts | 407 --
>  arch/powerpc/boot/dts/obs600.dts  | 314 
>  arch/powerpc/boot/ppcboot-hotfoot.h   | 119 ---
>  arch/powerpc/boot/ppcboot.h   |   2 +-
>  arch/powerpc/configs/40x.config   |   2 -
>  arch/powerpc/configs/40x/acadia_defconfig |  61 --
>  arch/powerpc/configs/40x/kilauea_defconfig|  69 --
>  arch/powerpc/configs/40x/klondike_defconfig   |  43 --
>  arch/powerpc/configs/40x/makalu_defconfig |  59 --
>  arch/powerpc/configs/40x/obs600_defconfig |  69 --
>  arch/powerpc/configs/40x/walnut_defconfig |  55 --
>  arch/powerpc/configs/ppc40x_defconfig |  74 --
>  arch/powerpc/include/asm/cacheflush.h |   2 +-
>  arch/powerpc/include/asm/cputable.h   |   7 -
>  arch/powerpc/include/asm/hw_irq.h |   8 +-
>  arch/powerpc/include/asm/irq.h|   2 +-
>  arch/powerpc/include/asm/kup.h|   2 +-
>  arch/powerpc/include/asm/mmu.h|   7 -
>  arch/powerpc/include/asm/nohash/32/mmu-40x.h  |  68 --
>  arch/powerpc/include/asm/nohash/32/pgtable.h  |   4 +-
>  arch/powerpc/include/asm/nohash/32/pte-40x.h  |  73 --
>  arch/powerpc/include/asm/nohash/mmu.h |   5 +-
>  arch/powerpc/include/asm/ppc_asm.h|   2 +-
>  arch/powerpc/include/asm/processor.h  |   2 +-
>  arch/powerpc/include/asm/ptrace.h |   2 +-
>  arch/powerpc/include/asm/reg.h|  27 +-
>  arch/powerpc/include/asm/reg_booke.h  | 113 +--
>  arch/powerpc/include/asm/time.h   |   7 +-
>  arch/powerpc/include/asm/udbg.h   |   1 -
>  arch/powerpc/kernel/Makefile  |   1 -
>  arch/powerpc/kernel/asm-offsets.c |   2 +-
>  arch/powerpc/kernel/cpu_specs.h   |   4 -
>  arch/powerpc/kernel/cpu_specs_40x.h   | 280 ---
>  arch/powerpc/kernel/entry_32.S|  48 +-
>  arch/powerpc/kernel/epapr_hcalls.S|   2 +-
>  arch/powerpc/kernel/head_32.h |  12 +-
>  arch/powerpc/kernel/head_40x.S| 721 --
>  arch/powerpc/kernel/head_booke.h  |   3 +-
>  arch/powerpc/kernel/irq.c |   2 +-
>  arch/powerpc/kernel/kgdb.c|   4 +-
>  arch/powerpc/kernel/misc_32.S |  40 -
>  arch/powerpc/kernel/process.c |   4 +-
>  arch/powerpc/kernel/setup.h   |   2 +-
>  arch/powerpc/kernel/setup_32.c|   2 +-
>  arch/powerpc/kernel/time.c|   2 +-
>  arch/powerpc/kernel/traps.c   |   2 +-
>  arch/powerpc/kernel/udbg.c|   3 -
>  arch/powerpc/kernel/udbg_16550.c  |  23 -
>  arch/powerpc/mm/fault.c   |   4 +-
>  arch/powerpc/mm/mmu_context.c |   2 +-
>  arch/powerpc/mm/mmu_decl.h|   8 +-
>  arch/powerpc/mm/nohash/40x.c  | 161 
>  arch/powerpc/mm/nohash/Makefile   |   1 -
>  

Re: [PATCH v2] ASoC: dt-bindings: fsl,ssi: Convert to YAML

2024-04-23 Thread Rob Herring
On Mon, Apr 22, 2024 at 01:48:14PM +0800, Shengjiu Wang wrote:
> Convert the fsl,ssi binding to YAML.
> 
> Add below compatible strings which were not listed
> in document:
> 
> fsl,imx50-ssi
> fsl,imx53-ssi
> fsl,imx25-ssi
> fsl,imx27-ssi
> fsl,imx6q-ssi
> fsl,imx6sl-ssi
> fsl,imx6sx-ssi
> 
> Add below fsl,mode strings which were not listed.
> 
> i2s-slave
> i2s-master
> lj-slave
> lj-master
> rj-slave
> rj-master
> 
> Add 'ac97-gpios' property which were not listed.
> Then dtbs_check can pass.
> 
> And remove the 'codec' description which should be
> in the 'codec' binding doc.
> 
> Signed-off-by: Shengjiu Wang 
> ---
> changes in v2:
> - change fallback string to const.
> - add dai-common.yaml
> - add ac97-gpios property
> 
>  .../devicetree/bindings/sound/fsl,ssi.txt |  87 
>  .../devicetree/bindings/sound/fsl,ssi.yaml| 192 ++
>  2 files changed, 192 insertions(+), 87 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/sound/fsl,ssi.txt
>  create mode 100644 Documentation/devicetree/bindings/sound/fsl,ssi.yaml
> 
> diff --git a/Documentation/devicetree/bindings/sound/fsl,ssi.txt 
> b/Documentation/devicetree/bindings/sound/fsl,ssi.txt
> deleted file mode 100644
> index 7e15a85cecd2..
> --- a/Documentation/devicetree/bindings/sound/fsl,ssi.txt
> +++ /dev/null
> @@ -1,87 +0,0 @@
> -Freescale Synchronous Serial Interface
> -
> -The SSI is a serial device that communicates with audio codecs.  It can
> -be programmed in AC97, I2S, left-justified, or right-justified modes.
> -
> -Required properties:
> -- compatible:   Compatible list, should contain one of the following
> -compatibles:
> -  fsl,mpc8610-ssi
> -  fsl,imx51-ssi
> -  fsl,imx35-ssi
> -  fsl,imx21-ssi
> -- cell-index:   The SSI, <0> = SSI1, <1> = SSI2, and so on.
> -- reg:  Offset and length of the register set for the device.
> -- interrupts:where a is the interrupt number and b is a
> -field that represents an encoding of the sense and
> -level information for the interrupt.  This should be
> -encoded based on the information in section 2)
> -depending on the type of interrupt controller you
> -have.
> -- fsl,fifo-depth:   The number of elements in the transmit and receive FIFOs.
> -This number is the maximum allowed value for 
> SFCSR[TFWM0].
> - - clocks:  "ipg" - Required clock for the SSI unit
> -"baud" - Required clock for SSI master mode. Otherwise 
> this
> -   clock is not used
> -
> -Required are also ac97 link bindings if ac97 is used. See
> -Documentation/devicetree/bindings/sound/soc-ac97link.txt for the necessary
> -bindings.
> -
> -Optional properties:
> -- codec-handle: Phandle to a 'codec' node that defines an audio
> -codec connected to this SSI.  This node is typically
> -a child of an I2C or other control node.
> -- fsl,fiq-stream-filter: Bool property. Disabled DMA and use FIQ instead to
> - filter the codec stream. This is necessary for some boards
> - where an incompatible codec is connected to this SSI, e.g.
> - on pca100 and pcm043.
> -- dmas:  Generic dma devicetree binding as described in
> - Documentation/devicetree/bindings/dma/dma.txt.
> -- dma-names: Two dmas have to be defined, "tx" and "rx", if fsl,imx-fiq
> - is not defined.
> -- fsl,mode: The operating mode for the AC97 interface only.
> -"ac97-slave" - AC97 mode, SSI is clock slave
> -"ac97-master" - AC97 mode, SSI is clock master
> -- fsl,ssi-asynchronous:
> -If specified, the SSI is to be programmed in asynchronous
> -mode.  In this mode, pins SRCK, STCK, SRFS, and STFS must
> -all be connected to valid signals.  In synchronous mode,
> -SRCK and SRFS are ignored.  Asynchronous mode allows
> -playback and capture to use different sample sizes and
> -sample rates.  Some drivers may require that SRCK and 
> STCK
> -be connected together, and SRFS and STFS be connected
> -together.  This would still allow different sample sizes,
> -but not different sample rates.
> -- fsl,playback-dma: Phandle to a node for the DMA channel to use for
> -playback of audio.  This is typically dictated by SOC
> -design.  See the notes below.
> -Only used on Power Architecture.
> -- fsl,capture-dma:  Phandle to a node for the DMA channel to use for
> -capture (recording) of audio.  This is 

Re: [PATCH 5/5] dt-bindings: hwmon: ibm,p8-occ-hwmon: move to trivial devices

2024-03-21 Thread Rob Herring


On Thu, 21 Mar 2024 19:43:46 +0100, Javier Carrasco wrote:
> This binding meets the requirements to be converted to dtschema
> via trivial-devices.yaml.
> 
> Signed-off-by: Javier Carrasco 
> ---
>  .../devicetree/bindings/hwmon/ibm,p8-occ-hwmon.txt | 25 
> --
>  .../devicetree/bindings/trivial-devices.yaml   |  2 ++
>  2 files changed, 2 insertions(+), 25 deletions(-)
> 

Reviewed-by: Rob Herring 



Re: [PATCH 3/5] dt-bindings: hwmon: pwm-fan: drop text file

2024-03-21 Thread Rob Herring


On Thu, 21 Mar 2024 19:43:44 +0100, Javier Carrasco wrote:
> This binding was converted to dtschema a year ago.
> 
> Signed-off-by: Javier Carrasco 
> ---
>  Documentation/devicetree/bindings/hwmon/pwm-fan.txt | 1 -
>  1 file changed, 1 deletion(-)
> 

Acked-by: Rob Herring 



Re: [PATCH 1/5] dt-bindings: hwmon: as370: convert to dtschema

2024-03-21 Thread Rob Herring


On Thu, 21 Mar 2024 19:43:42 +0100, Javier Carrasco wrote:
> Convert existing binding to support validation.
> 
> This is a straightforward conversion with now new properties.
> 
> Signed-off-by: Javier Carrasco 
> ---
>  Documentation/devicetree/bindings/hwmon/as370.txt  | 11 
>  .../devicetree/bindings/hwmon/syna,as370.yaml  | 32 
> ++
>  2 files changed, 32 insertions(+), 11 deletions(-)
> 

Reviewed-by: Rob Herring 



Re: [PATCH 4/5] dt-bindings: hwmon: stts751: convert to dtschema

2024-03-21 Thread Rob Herring


On Thu, 21 Mar 2024 19:43:45 +0100, Javier Carrasco wrote:
> Convert existing binding to support validation.
> 
> This is a straightforward conversion with no new properties.
> 
> Signed-off-by: Javier Carrasco 
> ---
>  .../devicetree/bindings/hwmon/st,stts751.yaml  | 41 
> ++
>  .../devicetree/bindings/hwmon/stts751.txt  | 15 
>  2 files changed, 41 insertions(+), 15 deletions(-)
> 

My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:

dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/hwmon/ibm,powernv.example.dtb:
 sensor: 'reg' is a required property
from schema $id: http://devicetree.org/schemas/hwmon/st,stts751.yaml#
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/hwmon/ibm,powernv.example.dtb:
 sensor: 'sensor-id' does not match any of the regexes: 'pinctrl-[0-9]+'
from schema $id: http://devicetree.org/schemas/hwmon/st,stts751.yaml#

doc reference errors (make refcheckdocs):

See 
https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20240321-hwmon_dtschema-v1-4-96c3810c3...@gmail.com

The base for the series is generally the latest rc1. A different dependency
should be noted in *this* patch.

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:

pip3 install dtschema --upgrade

Please check and re-submit after running the above command yourself. Note
that DT_SCHEMA_FILES can be set to your schema file to speed up checking
your schema. However, it must be unset to test all examples with your schema.



Re: [PATCH 2/5] dt-bindings: hwmon: ibmpowernv: convert to dtschema

2024-03-21 Thread Rob Herring


On Thu, 21 Mar 2024 19:43:43 +0100, Javier Carrasco wrote:
> Convert existing binding to support validation.
> 
> This is a straightforward conversion with now new properties.
> 
> Signed-off-by: Javier Carrasco 
> ---
>  .../devicetree/bindings/hwmon/ibm,powernv.yaml | 37 
> ++
>  .../devicetree/bindings/hwmon/ibmpowernv.txt   | 23 --
>  2 files changed, 37 insertions(+), 23 deletions(-)
> 

My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:

dtschema/dtc warnings/errors:
Documentation/devicetree/bindings/hwmon/ibm,powernv.example.dtb: 
/example-0/sensor: failed to match any schema with compatible: ['st,stts751']

doc reference errors (make refcheckdocs):

See 
https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20240321-hwmon_dtschema-v1-2-96c3810c3...@gmail.com

The base for the series is generally the latest rc1. A different dependency
should be noted in *this* patch.

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:

pip3 install dtschema --upgrade

Please check and re-submit after running the above command yourself. Note
that DT_SCHEMA_FILES can be set to your schema file to speed up checking
your schema. However, it must be unset to test all examples with your schema.



Re: [PATCH 1/2] powerpc/prom_init: Replace linux,sml-base/sml-size with linux,sml-log

2024-03-12 Thread Rob Herring
On Tue, Mar 12, 2024 at 09:32:50PM +1100, Michael Ellerman wrote:
> Rob Herring  writes:
> > On Fri, Mar 08, 2024 at 07:23:35AM -0500, Stefan Berger wrote:
> >> On 3/7/24 16:52, Rob Herring wrote:
> >> > On Thu, Mar 07, 2024 at 09:41:31PM +1100, Michael Ellerman wrote:
> >> > > Stefan Berger  writes:
> >> > > > linux,sml-base holds the address of a buffer with the TPM log. This
> >> > > > buffer may become invalid after a kexec and therefore embed the 
> >> > > > whole TPM
> >> > > > log in linux,sml-log. This helps to protect the log since it is 
> >> > > > properly
> >> > > > carried across a kexec with both of the kexec syscalls.
> >> > > > 
> >> > > > Signed-off-by: Stefan Berger 
> >> > > > ---
> >> > > >   arch/powerpc/kernel/prom_init.c | 8 ++--
> >> > > >   1 file changed, 2 insertions(+), 6 deletions(-)
> >> > > > 
> >> 
> >> > 
> >> > 
> >> > > Also adding the new linux,sml-log property should be accompanied by a
> >> > > change to the device tree binding.
> >> > > 
> >> > > The syntax is not very obvious to me, but possibly something like?
> >> > > 
> >> > > diff --git a/Documentation/devicetree/bindings/tpm/ibm,vtpm.yaml 
> >> > > b/Documentation/devicetree/bindings/tpm/ibm,vtpm.yaml
> >> > > index 50a3fd31241c..cd75037948bc 100644
> >> > > --- a/Documentation/devicetree/bindings/tpm/ibm,vtpm.yaml
> >> > > +++ b/Documentation/devicetree/bindings/tpm/ibm,vtpm.yaml
> >> > > @@ -74,8 +74,6 @@ required:
> >> > > - ibm,my-dma-window
> >> > > - ibm,my-drc-index
> >> > > - ibm,loc-code
> >> > > -  - linux,sml-base
> >> > > -  - linux,sml-size
> >> > 
> >> > Dropping required properties is an ABI break. If you drop them, an older
> >> > OS version won't work.
> >> 
> >> 1) On PowerVM and KVM on Power these two properties were added in the Linux
> >> code. I replaced the creation of these properties with creation of
> >> linux,sml-log (1/2 in this series). I also replaced the handling of
> >> these two (2/2 in this series) for these two platforms but leaving it for
> >> powernv systems where the firmware creates these.
> >
> > Okay, I guess your case is not a ABI break if the kernel is populating 
> > it and the same kernel consumes it. 
> >
> > You failed to answer my question on using /reserved-memory. Again, why 
> > can't that be used? That is the standard way we prevent chunks of memory 
> > from being clobbered.
> 
> Yes I think that would mostly work. I don't see support for
> /reserved-memory in kexec-tools, so that would need fixing I think.
> 
> My logic was that the memory is not special. It's just a buffer we
> allocated during early boot to store the log. There isn't anything else
> in the system that relies on that memory remaining untouched. So it
> seemed cleaner to just put the log in the device tree, rather than a
> pointer to it.

My issue is we already have 2 ways to describe the log to the OS. I 
don't see a good reason to add a 3rd way. (Though it might actually be a 
4th way, because the chosen property for the last attempt was accepted 
to dtschema yet the code has been abandoned.)

If you put the log into the DT, then the memory for the log remains 
untouched too because the FDT remains untouched. For reserved-memory 
regions, the OS is free to free them if it knows what the region is and 
that it is no longer needed. IOW, if freeing the log memory is desired, 
then the suggested approach doesn't work.

> 
> Having the log external to the device tree creates several problems,
> like the crash kernel region colliding with it, it being clobbered by
> kexec, etc.

We have multiple regions to pass/maintain thru kexec, so how does having 
one less really matter?

Rob


Re: [PATCH 1/2] powerpc/prom_init: Replace linux,sml-base/sml-size with linux,sml-log

2024-03-08 Thread Rob Herring
On Fri, Mar 08, 2024 at 07:23:35AM -0500, Stefan Berger wrote:
> 
> 
> On 3/7/24 16:52, Rob Herring wrote:
> > On Thu, Mar 07, 2024 at 09:41:31PM +1100, Michael Ellerman wrote:
> > > Stefan Berger  writes:
> > > > linux,sml-base holds the address of a buffer with the TPM log. This
> > > > buffer may become invalid after a kexec and therefore embed the whole 
> > > > TPM
> > > > log in linux,sml-log. This helps to protect the log since it is properly
> > > > carried across a kexec with both of the kexec syscalls.
> > > > 
> > > > Signed-off-by: Stefan Berger 
> > > > ---
> > > >   arch/powerpc/kernel/prom_init.c | 8 ++--
> > > >   1 file changed, 2 insertions(+), 6 deletions(-)
> > > > 
> 
> > 
> > 
> > > Also adding the new linux,sml-log property should be accompanied by a
> > > change to the device tree binding.
> > > 
> > > The syntax is not very obvious to me, but possibly something like?
> > > 
> > > diff --git a/Documentation/devicetree/bindings/tpm/ibm,vtpm.yaml 
> > > b/Documentation/devicetree/bindings/tpm/ibm,vtpm.yaml
> > > index 50a3fd31241c..cd75037948bc 100644
> > > --- a/Documentation/devicetree/bindings/tpm/ibm,vtpm.yaml
> > > +++ b/Documentation/devicetree/bindings/tpm/ibm,vtpm.yaml
> > > @@ -74,8 +74,6 @@ required:
> > > - ibm,my-dma-window
> > > - ibm,my-drc-index
> > > - ibm,loc-code
> > > -  - linux,sml-base
> > > -  - linux,sml-size
> > 
> > Dropping required properties is an ABI break. If you drop them, an older
> > OS version won't work.
> 
> 1) On PowerVM and KVM on Power these two properties were added in the Linux
> code. I replaced the creation of these properties with creation of
> linux,sml-log (1/2 in this series). I also replaced the handling of
> these two (2/2 in this series) for these two platforms but leaving it for
> powernv systems where the firmware creates these.

Okay, I guess your case is not a ABI break if the kernel is populating 
it and the same kernel consumes it. 

You failed to answer my question on using /reserved-memory. Again, why 
can't that be used? That is the standard way we prevent chunks of memory 
from being clobbered. There's already support for describing the TPM log 
that way anyways. The only reasoning I can see writing out a node for 
that is harder than just adding a property, but that's not a great 
argument IMO.


> 2) There is an example in the ibm,vtpm.yaml file that has both of these
> and the test case still passes the check when the two entries above are
> removed. I will post v2 with the changes to the DT bindings for
> linux,sml-log including an example for linux,sml-log. [The test cases fail,
> as expected, when an additional property is added, such as when
> linux,sml-base is added when linux,sml-log is there or linux,sml-log is
> added when linux,sml-base is there.]

Sure, removing a required property is never going to break the DT 
checks. What would break is a client (OS) version that only understands 
linux,sml-base and can no longer get the log assuming getting the log 
itself was required. 

Rob


Re: [PATCH 1/2] powerpc/prom_init: Replace linux,sml-base/sml-size with linux,sml-log

2024-03-07 Thread Rob Herring
On Thu, Mar 07, 2024 at 09:41:31PM +1100, Michael Ellerman wrote:
> Stefan Berger  writes:
> > linux,sml-base holds the address of a buffer with the TPM log. This
> > buffer may become invalid after a kexec and therefore embed the whole TPM
> > log in linux,sml-log. This helps to protect the log since it is properly
> > carried across a kexec with both of the kexec syscalls.
> >
> > Signed-off-by: Stefan Berger 
> > ---
> >  arch/powerpc/kernel/prom_init.c | 8 ++--
> >  1 file changed, 2 insertions(+), 6 deletions(-)
> >
> > diff --git a/arch/powerpc/kernel/prom_init.c 
> > b/arch/powerpc/kernel/prom_init.c
> > index e67effdba85c..41268c30de4c 100644
> > --- a/arch/powerpc/kernel/prom_init.c
> > +++ b/arch/powerpc/kernel/prom_init.c
> > @@ -1956,12 +1956,8 @@ static void __init prom_instantiate_sml(void)
> >  
> > reserve_mem(base, size);
> >  
> > -   prom_setprop(ibmvtpm_node, "/vdevice/vtpm", "linux,sml-base",
> > -, sizeof(base));
> > -   prom_setprop(ibmvtpm_node, "/vdevice/vtpm", "linux,sml-size",
> > -, sizeof(size));
> > -
> > -   prom_debug("sml base = 0x%llx\n", base);
> > +   prom_setprop(ibmvtpm_node, "/vdevice/vtpm", "linux,sml-log",
> > +(void *)base, size);
> 
> As we discussed via chat, doing it this way sucks the full content of
> the log back into Open Firmware. 
> 
> That relies on OF handling such big properties, and also means more
> memory will be consumed, which can cause problems early in boot.
> 
> A better solution is to explicitly add the log to the FDT in the
> flattening phase.
> 

Why can't you just use /reserved-memory here? That should be preserved 
from one kernel entry to the next.


> Also adding the new linux,sml-log property should be accompanied by a
> change to the device tree binding.
> 
> The syntax is not very obvious to me, but possibly something like?
> 
> diff --git a/Documentation/devicetree/bindings/tpm/ibm,vtpm.yaml 
> b/Documentation/devicetree/bindings/tpm/ibm,vtpm.yaml
> index 50a3fd31241c..cd75037948bc 100644
> --- a/Documentation/devicetree/bindings/tpm/ibm,vtpm.yaml
> +++ b/Documentation/devicetree/bindings/tpm/ibm,vtpm.yaml
> @@ -74,8 +74,6 @@ required:
>- ibm,my-dma-window
>- ibm,my-drc-index
>- ibm,loc-code
> -  - linux,sml-base
> -  - linux,sml-size

Dropping required properties is an ABI break. If you drop them, an older 
OS version won't work.

>  
>  allOf:
>- $ref: tpm-common.yaml#
> diff --git a/Documentation/devicetree/bindings/tpm/tpm-common.yaml 
> b/Documentation/devicetree/bindings/tpm/tpm-common.yaml
> index 3c1241b2a43f..616604707c95 100644
> --- a/Documentation/devicetree/bindings/tpm/tpm-common.yaml
> +++ b/Documentation/devicetree/bindings/tpm/tpm-common.yaml
> @@ -25,6 +25,11 @@ properties:
>base address of reserved memory allocated for firmware event log
>  $ref: /schemas/types.yaml#/definitions/uint64
>  
> +  linux,sml-log:

Why is this Linux specific?

> +description:
> +  Content of firmware event log
> +$ref: /schemas/types.yaml#/definitions/uint8-array
> +
>linux,sml-size:
>  description:
>size of reserved memory allocated for firmware event log
> @@ -53,15 +58,22 @@ dependentRequired:
>linux,sml-base: ['linux,sml-size']
>linux,sml-size: ['linux,sml-base']
>  
> -# must only have either memory-region or linux,sml-base
> +# must only have either memory-region or linux,sml-base/size or linux,sml-log
>  # as well as either resets or reset-gpios
>  dependentSchemas:
>memory-region:
>  properties:
>linux,sml-base: false
> +  linux,sml-log: false
>linux,sml-base:
>  properties:
>memory-region: false
> +  linux,sml-log: false
> +  linux,sml-log:
> +properties:
> +  memory-region: false
> +  linux,sml-base: false
> +  linux,sml-size: false
>resets:
>  properties:
>reset-gpios: false
> 
> 
> cheers


Re: [PATCH 0/2] Preserve TPM log across kexec

2024-03-07 Thread Rob Herring
On Wed, Mar 06, 2024 at 11:08:20AM -0500, Stefan Berger wrote:
> 
> 
> On 3/6/24 10:55, Stefan Berger wrote:
> > This series resolves an issue on PowerVM and KVM on Power where the memory
> > the TPM log was held in may become inaccessible or corrupted after a kexec
> > soft reboot. The solution on these two platforms is to store the whole log
> > in the device tree because the device tree is preserved across a kexec with
> > either of the two kexec syscalls.
> > 
> FYI: This was the previous attempt that didn't work with the older kexec
> syscall: 
> https://lore.kernel.org/lkml/4afde78d-e138-9eee-50e0-dbd32f4dc...@linux.ibm.com/T/#m158630d214837e41858b03d4b025e6f96cb8f251

Doesn't everyone else still need that? Is powerpc the only ones that 
care about the old kexec syscall?

Rob


Re: [PATCH] soc: fsl: qbman: Remove RESERVEDMEM_OF_DECLARE usage

2024-03-05 Thread Rob Herring


On Thu, 01 Feb 2024 13:29:30 -0600, Rob Herring wrote:
> There is no reason to use RESERVEDMEM_OF_DECLARE() as the initialization
> hook just saves off the base address and size. Use of
> RESERVEDMEM_OF_DECLARE() is reserved for non-driver code and
> initialization which must be done early. For qbman, retrieving the
> address and size can be done in probe just as easily.
> 
> Signed-off-by: Rob Herring 
> ---
>  drivers/soc/fsl/qbman/bman_ccsr.c | 27 +++-
>  drivers/soc/fsl/qbman/dpaa_sys.c  | 12 +++--
>  drivers/soc/fsl/qbman/dpaa_sys.h  |  4 +-
>  drivers/soc/fsl/qbman/qman_ccsr.c | 73 ++-
>  4 files changed, 38 insertions(+), 78 deletions(-)
> 

No one is going to pick this up? I applied to the DT tree.

Rob


[PATCH] soc: fsl: qbman: Remove RESERVEDMEM_OF_DECLARE usage

2024-02-01 Thread Rob Herring
There is no reason to use RESERVEDMEM_OF_DECLARE() as the initialization
hook just saves off the base address and size. Use of
RESERVEDMEM_OF_DECLARE() is reserved for non-driver code and
initialization which must be done early. For qbman, retrieving the
address and size can be done in probe just as easily.

Signed-off-by: Rob Herring 
---
 drivers/soc/fsl/qbman/bman_ccsr.c | 27 +++-
 drivers/soc/fsl/qbman/dpaa_sys.c  | 12 +++--
 drivers/soc/fsl/qbman/dpaa_sys.h  |  4 +-
 drivers/soc/fsl/qbman/qman_ccsr.c | 73 ++-
 4 files changed, 38 insertions(+), 78 deletions(-)

diff --git a/drivers/soc/fsl/qbman/bman_ccsr.c 
b/drivers/soc/fsl/qbman/bman_ccsr.c
index cb24a08be084..b0f26f6f731e 100644
--- a/drivers/soc/fsl/qbman/bman_ccsr.c
+++ b/drivers/soc/fsl/qbman/bman_ccsr.c
@@ -144,17 +144,6 @@ static int bm_set_memory(u64 ba, u32 size)
 static dma_addr_t fbpr_a;
 static size_t fbpr_sz;
 
-static int bman_fbpr(struct reserved_mem *rmem)
-{
-   fbpr_a = rmem->base;
-   fbpr_sz = rmem->size;
-
-   WARN_ON(!(fbpr_a && fbpr_sz));
-
-   return 0;
-}
-RESERVEDMEM_OF_DECLARE(bman_fbpr, "fsl,bman-fbpr", bman_fbpr);
-
 static irqreturn_t bman_isr(int irq, void *ptr)
 {
u32 isr_val, ier_val, ecsr_val, isr_mask, i;
@@ -242,17 +231,11 @@ static int fsl_bman_probe(struct platform_device *pdev)
return -ENODEV;
}
 
-   /*
-* If FBPR memory wasn't defined using the qbman compatible string
-* try using the of_reserved_mem_device method
-*/
-   if (!fbpr_a) {
-   ret = qbman_init_private_mem(dev, 0, _a, _sz);
-   if (ret) {
-   dev_err(dev, "qbman_init_private_mem() failed 0x%x\n",
-   ret);
-   return -ENODEV;
-   }
+   ret = qbman_init_private_mem(dev, 0, "fsl,bman-fbpr", _a, 
_sz);
+   if (ret) {
+   dev_err(dev, "qbman_init_private_mem() failed 0x%x\n",
+   ret);
+   return -ENODEV;
}
 
dev_dbg(dev, "Allocated FBPR 0x%llx 0x%zx\n", fbpr_a, fbpr_sz);
diff --git a/drivers/soc/fsl/qbman/dpaa_sys.c b/drivers/soc/fsl/qbman/dpaa_sys.c
index 33751450047e..e1d7b79cc450 100644
--- a/drivers/soc/fsl/qbman/dpaa_sys.c
+++ b/drivers/soc/fsl/qbman/dpaa_sys.c
@@ -34,8 +34,8 @@
 /*
  * Initialize a devices private memory region
  */
-int qbman_init_private_mem(struct device *dev, int idx, dma_addr_t *addr,
-   size_t *size)
+int qbman_init_private_mem(struct device *dev, int idx, const char *compat,
+  dma_addr_t *addr, size_t *size)
 {
struct device_node *mem_node;
struct reserved_mem *rmem;
@@ -44,8 +44,12 @@ int qbman_init_private_mem(struct device *dev, int idx, 
dma_addr_t *addr,
 
mem_node = of_parse_phandle(dev->of_node, "memory-region", idx);
if (!mem_node) {
-   dev_err(dev, "No memory-region found for index %d\n", idx);
-   return -ENODEV;
+   mem_node = of_find_compatible_node(NULL, NULL, compat);
+   if (!mem_node) {
+   dev_err(dev, "No memory-region found for index %d or 
compatible '%s'\n",
+   idx, compat);
+   return -ENODEV;
+   }
}
 
rmem = of_reserved_mem_lookup(mem_node);
diff --git a/drivers/soc/fsl/qbman/dpaa_sys.h b/drivers/soc/fsl/qbman/dpaa_sys.h
index ae8afa552b1e..16485bde9636 100644
--- a/drivers/soc/fsl/qbman/dpaa_sys.h
+++ b/drivers/soc/fsl/qbman/dpaa_sys.h
@@ -101,8 +101,8 @@ static inline u8 dpaa_cyc_diff(u8 ringsize, u8 first, u8 
last)
 #define DPAA_GENALLOC_OFF  0x8000
 
 /* Initialize the devices private memory region */
-int qbman_init_private_mem(struct device *dev, int idx, dma_addr_t *addr,
-   size_t *size);
+int qbman_init_private_mem(struct device *dev, int idx, const char *compat,
+  dma_addr_t *addr, size_t *size);
 
 /* memremap() attributes for different platforms */
 #ifdef CONFIG_PPC
diff --git a/drivers/soc/fsl/qbman/qman_ccsr.c 
b/drivers/soc/fsl/qbman/qman_ccsr.c
index 157659fd033a..392e54f14dbe 100644
--- a/drivers/soc/fsl/qbman/qman_ccsr.c
+++ b/drivers/soc/fsl/qbman/qman_ccsr.c
@@ -468,28 +468,6 @@ static int zero_priv_mem(phys_addr_t addr, size_t sz)
 
return 0;
 }
-
-static int qman_fqd(struct reserved_mem *rmem)
-{
-   fqd_a = rmem->base;
-   fqd_sz = rmem->size;
-
-   WARN_ON(!(fqd_a && fqd_sz));
-   return 0;
-}
-RESERVEDMEM_OF_DECLARE(qman_fqd, "fsl,qman-fqd", qman_fqd);
-
-static int qman_pfdr(struct reserved_mem *rmem)
-{
-   pfdr_a = rmem->base;
-   pfdr_sz = rmem->size;
-
-   WARN_ON(!(pfdr_a && pfdr_sz));
-
-   return 0;
-}
-RESERVEDMEM

Re: [PATCH] dt-bindings: soc: fsl: narrow regex for unit address to hex numbers

2024-01-30 Thread Rob Herring


On Tue, 23 Jan 2024 09:35:05 +0100, Krzysztof Kozlowski wrote:
> Regular expression used to match the unit address part should not allow
> non-hex numbers.
> 
> Signed-off-by: Krzysztof Kozlowski 
> ---
>  .../devicetree/bindings/soc/fsl/fsl,layerscape-dcfg.yaml| 2 +-
>  .../devicetree/bindings/soc/fsl/fsl,layerscape-scfg.yaml| 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 

Acked-by: Rob Herring 



Re: [PATCHv3 RESEND 10/10] ASoC: dt-bindings: fsl-asoc-card: add compatible for generic codec

2023-12-20 Thread Rob Herring
On Mon, Dec 18, 2023 at 01:40:58PM +0100, Elinor Montmasson wrote:
> Add documentation about new dts bindings following new support
> for compatible "fsl,imx-audio-generic".
> 
> Some CPU DAI don't require a real audio codec. The new compatible
> "fsl,imx-audio-generic" allows using the driver with codec drivers
> SPDIF DIT and SPDIF DIR as dummy codecs.
> It also allows using not pre-configured audio codecs which
> don't require specific control through a codec driver.
> 
> The new dts properties give the possibility to set some parameters
> about the CPU DAI usually set through the codec configuration.
> 
> Signed-off-by: Elinor Montmasson 
> Co-authored-by: Philip-Dylan Gleonec 
> 
> ---
>  .../bindings/sound/fsl-asoc-card.txt  | 28 ++-
>  1 file changed, 27 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/sound/fsl-asoc-card.txt 
> b/Documentation/devicetree/bindings/sound/fsl-asoc-card.txt
> index 4e8dbc5abfd1..f137ef2154e3 100644
> --- a/Documentation/devicetree/bindings/sound/fsl-asoc-card.txt
> +++ b/Documentation/devicetree/bindings/sound/fsl-asoc-card.txt
> @@ -17,6 +17,9 @@ Note: The card is initially designed for those sound cards 
> who use AC'97, I2S
>and PCM DAI formats. However, it'll be also possible to support those 
> non
>AC'97/I2S/PCM type sound cards, such as S/PDIF audio and HDMI audio, as
>long as the driver has been properly upgraded.
> +  To use CPU DAIs that do not require a codec such as an S/PDIF 
> controller,
> +  or to use a DAI to output or capture raw I2S/TDM data, you can
> +  use the compatible "fsl,imx-audio-generic".
>  
>  
>  The compatible list for this generic sound card currently:
> @@ -48,6 +51,8 @@ The compatible list for this generic sound card currently:
>  
>   "fsl,imx-audio-nau8822"
>  
> + "fsl,imx-audio-generic"
> +
>  Required properties:
>  
>- compatible   : Contains one of entries in the compatible 
> list.
> @@ -56,7 +61,11 @@ Required properties:
>  
>- audio-cpu: The phandle of an CPU DAI controller
>  
> -  - audio-codec  : The phandle of an audio codec
> +  - audio-codec  : The phandle of an audio codec.
> +   If using the "fsl,imx-audio-generic" compatible,
> +   give instead a pair of phandles with the
> +   spdif_transmitter first (driver SPDIF DIT) and the
> +   spdif_receiver second (driver SPDIF DIR).
>  
>  Optional properties:
>  
> @@ -87,6 +96,23 @@ Optional properties:
>- frame-inversion  : dai-link uses frame clock inversion, for details see 
> simple-card.yaml.
>- bitclock-inversion   : dai-link uses bit clock inversion, for 
> details see simple-card.yaml.
>- mclk-id  : main clock id, specific for each card configuration.
> +   For multi-codec configurations, an array of ids can be
> +   given, one for each codec.
> +
> +Optional, relevant only with the "fsl,imx-audio-generic" compatible:
> +
> +  - cpu-slot-width   : Indicates a specific TDM slot width in bits.
> +  - cpu-slot-num : Indicates a specific number of TDM slots per frame.

Pretty sure I've seen other bindings with TDM slot properties. A sign we 
need something common if we don't already have something.

> +
> +  - cpu-sysclk-freq-rx   : Frequency of the CPU DAI sys clock for Rx.
> +  - cpu-sysclk-freq-tx   : Frequency of the CPU DAI sys clock for Tx.
> +
> +  - cpu-sysclk-dir-rx-out: Boolean property. Specifies sys clock 
> direction
> +   as 'out' on initialization for Rx.
> +   If not set, default direction is 'in'.
> +  - cpu-sysclk-dir-tx-out: Boolean property. Specifies sys clock 
> direction
> +   as 'out' on initialization for Tx.
> +   If not set, default direction is 'in'.

Looks like clock stuff. Use the clock binding.

Rob


Re: [PATCH v1 2/4] of: Reimplement of_machine_is_compatible() using of_machine_compatible_match()

2023-12-07 Thread Rob Herring
On Wed, Dec 06, 2023 at 05:13:33PM +0100, Christophe Leroy wrote:
> of_machine_compatible_match() works with a table of strings.
> of_machine_is_compatible() is a simplier version with only one string.
> 
> Re-implement of_machine_is_compatible() by setting a table of strings
> with a single string then using of_machine_compatible_match().
> 
> Suggested-by: Rob Herring 
> Signed-off-by: Christophe Leroy 
> ---
>  drivers/of/base.c  | 22 +-
>  include/linux/of.h | 15 ++-
>  2 files changed, 15 insertions(+), 22 deletions(-)
> 
> diff --git a/drivers/of/base.c b/drivers/of/base.c
> index 9020be2eb4d5..73c3a754bad1 100644
> --- a/drivers/of/base.c
> +++ b/drivers/of/base.c
> @@ -414,27 +414,7 @@ bool of_machine_compatible_match(const char *const 
> *compats)
>  
>   return rc != 0;
>  }
> -
> -/**
> - * of_machine_is_compatible - Test root of device tree for a given 
> compatible value
> - * @compat: compatible string to look for in root node's compatible property.
> - *
> - * Return: A positive integer if the root node has the given value in its
> - * compatible property.
> - */
> -int of_machine_is_compatible(const char *compat)
> -{
> - struct device_node *root;
> - int rc = 0;
> -
> - root = of_find_node_by_path("/");
> - if (root) {
> - rc = of_device_is_compatible(root, compat);
> - of_node_put(root);
> - }
> - return rc;
> -}
> -EXPORT_SYMBOL(of_machine_is_compatible);
> +EXPORT_SYMBOL(of_machine_compatible_match);
>  
>  /**
>   *  __of_device_is_available - check if a device is available for use
> diff --git a/include/linux/of.h b/include/linux/of.h
> index e3418babc203..a0f70be5007f 100644
> --- a/include/linux/of.h
> +++ b/include/linux/of.h
> @@ -402,9 +402,22 @@ extern void of_alias_scan(void * (*dt_alloc)(u64 size, 
> u64 align));
>  extern int of_alias_get_id(struct device_node *np, const char *stem);
>  extern int of_alias_get_highest_id(const char *stem);
>  
> -extern int of_machine_is_compatible(const char *compat);
>  bool of_machine_compatible_match(const char *const *compats);
>  
> +/**
> + * of_machine_is_compatible - Test root of device tree for a given 
> compatible value
> + * @compat: compatible string to look for in root node's compatible property.
> + *
> + * Return: A positive integer if the root node has the given value in its
> + * compatible property.

There is a subtle change that we really only return true/false instead 
of a score. In a quick scan, I don't see any callers caring. Lots of 
places we could use a list of compatibles instead though. Maybe this 
should just return a bool instead of int? Either way:

Reviewed-by: Rob Herring 


Re: [PATCH v1 1/4] of: Add of_machine_compatible_match()

2023-12-07 Thread Rob Herring


On Wed, 06 Dec 2023 17:13:32 +0100, Christophe Leroy wrote:
> From: Michael Ellerman 
> 
> We have of_machine_is_compatible() to check if a machine is compatible
> with a single compatible string. However some code is able to support
> multiple compatible boards, and so wants to check for one of many
> compatible strings.
> 
> So add of_machine_compatible_match() which takes a NULL terminated
> array of compatible strings to check against the root node's
> compatible property.
> 
> Compared to an open coded match this is slightly more self
> documenting, and also avoids the caller needing to juggle the root
> node either directly or via of_find_node_by_path().
> 
> Signed-off-by: Michael Ellerman 
> Signed-off-by: Christophe Leroy 
> ---
>  drivers/of/base.c  | 21 +
>  include/linux/of.h |  6 ++++++
>  2 files changed, 27 insertions(+)
> 

Reviewed-by: Rob Herring 



Re: [PATCH v1 4/4] powerpc: Stop using of_root

2023-12-07 Thread Rob Herring
On Wed, Dec 06, 2023 at 05:13:35PM +0100, Christophe Leroy wrote:
> Replace all usages of of_root by of_find_node_by_path("/")
> 
> Signed-off-by: Christophe Leroy 
> ---
>  arch/powerpc/kernel/secure_boot.c|  8 ++--
>  arch/powerpc/kexec/ranges.c  |  8 +---
>  arch/powerpc/mm/drmem.c  | 10 +-
>  arch/powerpc/mm/numa.c   |  6 --
>  arch/powerpc/platforms/52xx/efika.c  |  4 +++-
>  arch/powerpc/platforms/pasemi/pci.c  |  4 +++-
>  arch/powerpc/platforms/pseries/lparcfg.c |  6 +-
>  arch/powerpc/platforms/pseries/setup.c   | 12 +---
>  8 files changed, 40 insertions(+), 18 deletions(-)

Reviewed-by: Rob Herring 


Re: [PATCH v1 3/4] powerpc/machdep: Define 'compatibles' property in ppc_md and use it

2023-12-07 Thread Rob Herring
On Wed, Dec 06, 2023 at 05:13:34PM +0100, Christophe Leroy wrote:
> Most probe functions that do not use the 'compatible' string do
> nothing else than checking whether the machine is compatible with
> one of the strings in a NULL terminated table of strings.
> 
> Define that table of strings in ppc_md structure and check it directly
> from probe_machine() instead of using ppc_md.probe() for that.
> 
> Keep checking in ppc_md.probe() only for more complex probing.
> 
> All .compatible could be replaced with a single element NULL
> terminated list but that's not worth the churn. Can be do incrementaly
> in follow-up patches.
> 
> Signed-off-by: Christophe Leroy 
> ---
>  arch/powerpc/include/asm/machdep.h|  1 +
>  arch/powerpc/kernel/setup-common.c|  2 ++
>  arch/powerpc/platforms/40x/ppc40x_simple.c|  9 +++--
>  arch/powerpc/platforms/512x/mpc512x_generic.c |  4 +---
>  arch/powerpc/platforms/52xx/lite5200.c| 10 +-
>  arch/powerpc/platforms/52xx/mpc5200_simple.c  | 10 +-
>  arch/powerpc/platforms/83xx/mpc830x_rdb.c | 10 +-
>  arch/powerpc/platforms/83xx/mpc831x_rdb.c | 10 +-
>  arch/powerpc/platforms/83xx/mpc837x_rdb.c | 10 +-
>  arch/powerpc/platforms/85xx/corenet_generic.c |  2 +-
>  arch/powerpc/platforms/85xx/tqm85xx.c | 10 +-
>  11 files changed, 14 insertions(+), 64 deletions(-)

> -/*
> - * Called very early, MMU is off, device-tree isn't unflattened
> - */

Certainly an out of date comment as the unflattened API was being 
called.

Reviewed-by: Rob Herring 


Re: [PATCH] dt-bindings: fsl,dpaa2-console: drop unneeded quotes

2023-11-27 Thread Rob Herring


On Wed, 22 Nov 2023 15:44:19 -0700, Rob Herring wrote:
> Drop unneeded quotes over simple string values to fix a soon to be
> enabled yamllint warning:
> 
>   [error] string value is redundantly quoted with any quotes (quoted-strings)
> 
> Signed-off-by: Rob Herring 
> ---
>  Documentation/devicetree/bindings/misc/fsl,dpaa2-console.yaml | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 

Applied, thanks!



[PATCH] dt-bindings: fsl,dpaa2-console: drop unneeded quotes

2023-11-22 Thread Rob Herring
Drop unneeded quotes over simple string values to fix a soon to be
enabled yamllint warning:

  [error] string value is redundantly quoted with any quotes (quoted-strings)

Signed-off-by: Rob Herring 
---
 Documentation/devicetree/bindings/misc/fsl,dpaa2-console.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/misc/fsl,dpaa2-console.yaml 
b/Documentation/devicetree/bindings/misc/fsl,dpaa2-console.yaml
index 8cc951feb7df..59b83ea5e05e 100644
--- a/Documentation/devicetree/bindings/misc/fsl,dpaa2-console.yaml
+++ b/Documentation/devicetree/bindings/misc/fsl,dpaa2-console.yaml
@@ -12,7 +12,7 @@ maintainers:
 
 properties:
   compatible:
-const: "fsl,dpaa2-console"
+const: fsl,dpaa2-console
 
   reg:
 maxItems: 1
-- 
2.42.0



Re: [PATCH 7/8] of: replace command line handling

2023-11-16 Thread Rob Herring
On Thu, Nov 09, 2023 at 05:38:11PM -0800, Daniel Walker wrote:
> Rob Herring has complained about this section of code. I removed the
> command line handling code to the cmdline.h header. This hopefully makes
> it easier for Rob to maintain it (at least he doesn't have to look at it
> directly anymore).

Well, my goal is to eliminate drivers/of/, but no.

> I would like to add a Kconfig option called
> OF_DEPRECATED_CMDLINE which an architecture would set if it uses this code.

Which architecture needs this code? Do we wait and see who complains 
their platform broke and then go set this option? In the meantime, new 
platforms started depending on the new behavior and setting the option 
may break them. So we can't have a kconfig option.

> This would allow a platform to use the cmdline.h and the added function
> directly and remove the Kconfig option. This change would be in a subsequent
> patch.

Per platform code handling the cmdline is completely the wrong 
direction. Per arch behavior is bad enough.

Rob


Re: [PATCH v8 00/30] Add support for QMC HDLC, framer infrastructure and PEF2256 framer

2023-10-30 Thread Rob Herring
On Wed, Oct 25, 2023 at 12:32:15PM -0700, Jakub Kicinski wrote:
> On Wed, 25 Oct 2023 17:00:51 +0200 Herve Codina wrote:
> > > Which way will those patches go? Via some FSL SoC tree?  
> > 
> > This series seems mature now.
> > What is the plan next in order to have it applied ?
> > 
> > Don't hesitate to tell me if you prefer split series.
> 
> FWIW we are happy to take the drivers/net/ parts if there is no hard
> dependency. But there's no point taking that unless the SoC bits
> also go in for 6.7.
> 
> Li Yang, what are your expectations WRT merging this series?

I think it is too late for SoC stuff for 6.7. 

I picked up binding patches 6, 7, and 8 because 6 and 7 are the same as 
an additionalProperties fix I have in my tree. As 8 depends on them, I 
just picked it up too.

Rob


Re: Several kmemleak reports + "refcount_t: underflow; use-after-free" at boot when OF_UNITTEST + OF_OVERLAY is set (Kernel v6.6-rc6, PowerMac G5 11,2)

2023-10-30 Thread Rob Herring
On Wed, Oct 18, 2023 at 4:38 PM Erhard Furtner  wrote:
>
> Greetings!
>
> Getting this at every boot on my G5 with kernel v6.6-rc6 with OF_UNITTEST and 
> OF_OVERLAY selected:
>
> [...]
> ### dt-test ### EXPECT \ : OF: ERROR: of_node_release() detected bad
> of_node_put() on /testcase-data/refcount-node ### dt-test ### pass
> of_unittest_lifecycle():3189 OF: ERROR: of_node_release() detected bad
> of_node_put() on /testcase-data/refcount-node ### dt-test ### EXPECT / : OF:
> ERROR: of_node_release() detected bad of_node_put() on
> /testcase-data/refcount-node ### dt-test ### EXPECT \ : [ cut here
> ] ### dt-test ### EXPECT \ : WARNING: <> ### dt-test ###
> EXPECT \ : refcount_t: underflow; use-after-free. ### dt-test ### EXPECT \ :

The test tells you to expect a use-after-free...

> ---[ end trace <> ]--- ### dt-test ### pass of_unittest_lifecycle():3209
> [ cut here ]
> refcount_t: underflow; use-after-free.

Then you get a use-after-free. Looks like it is working as designed.

I believe it's the same with kmemleak.

Note that running DT unittests also taints the kernel. That's because
they are not meant to be run on a production system.

Rob


Re: [PATCH v4 1/2] ASoC: dt-bindings: sound-card-common: List sound widgets ignoring system suspend

2023-10-26 Thread Rob Herring
On Mon, Oct 23, 2023 at 10:07:17AM +0800, Chancel Liu wrote:
> Add a property to list audio sound widgets which are marked ignoring
> system suspend. Paths between these endpoints are still active over
> suspend of the main application processor that the current operating
> system is running.

Perhaps it would be better to define components used for low power 
audio rather than the OS mode that gets used. Isn't LPA just audio 
handling that doesn't require the OS CPU to be involved? So the state of 
the CPU is kind of orthogonal.

Rob


Re: [PATCH v3 1/2] ASoC: dt-bindings: sound-card-common: List DAPM endpoints ignoring system suspend

2023-10-12 Thread Rob Herring
On Wed, Oct 11, 2023 at 10:21:33PM +0100, Mark Brown wrote:
> On Wed, Oct 11, 2023 at 07:47:58PM +0800, Chancel Liu wrote:
> 
> > +  lpa-widgets:
> > +$ref: /schemas/types.yaml#/definitions/non-unique-string-array
> > +description: |
> > +  A list of DAPM endpoints which mark paths between these endpoints 
> > should
> > +  not be disabled when system enters in suspend state. LPA means low 
> > power
> > +  audio case. For example on asymmetric multiprocessor, there are 
> > Cortex-A
> 
> I suspect that the DT maintainers would prefer that this description be
> workshopped a bit to remove the Linux specifics.

And Cortex A/M specifics if this is a common binding.


>  I think the key thing
> here is that these are endpoints that can be active over suspend of the
> main application processor that the current operating system is running
> (system DT stuff is an interesting corner case here...), and the example
> is probably a bit specific.  Other bindings use "audio sound widgets"
> rather than "DAPM widgets".
> 
> We also shouldn't see that these endpoints "should not be disabled"
> since that implies that they should be left on even if they aren't
> active which isn't quite the case, instead it's that we can continue
> playing an audio stream through them in suspend.

This seems like one of those things that everyone has/does, and everyone 
handles it a bit differently. I applaud trying to do something common, 
but it isn't really common until we have multiple users.

Rob


[PATCH] usb: Use device_get_match_data()

2023-10-09 Thread Rob Herring
Use preferred device_get_match_data() instead of of_match_device() to
get the driver match data. With this, adjust the includes to explicitly
include the correct headers.

Signed-off-by: Rob Herring 
---
 drivers/usb/chipidea/ci_hdrc_usb2.c | 11 +--
 drivers/usb/dwc2/params.c   | 21 ++---
 drivers/usb/gadget/udc/fsl_qe_udc.c | 10 +++---
 drivers/usb/misc/onboard_usb_hub.c  |  7 +--
 4 files changed, 15 insertions(+), 34 deletions(-)

diff --git a/drivers/usb/chipidea/ci_hdrc_usb2.c 
b/drivers/usb/chipidea/ci_hdrc_usb2.c
index 1321ee67f3b8..180a632dd7ba 100644
--- a/drivers/usb/chipidea/ci_hdrc_usb2.c
+++ b/drivers/usb/chipidea/ci_hdrc_usb2.c
@@ -9,9 +9,9 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -51,8 +51,8 @@ static int ci_hdrc_usb2_probe(struct platform_device *pdev)
struct device *dev = >dev;
struct ci_hdrc_usb2_priv *priv;
struct ci_hdrc_platform_data *ci_pdata = dev_get_platdata(dev);
+   const struct ci_hdrc_platform_data *data;
int ret;
-   const struct of_device_id *match;
 
if (!ci_pdata) {
ci_pdata = devm_kmalloc(dev, sizeof(*ci_pdata), GFP_KERNEL);
@@ -61,11 +61,10 @@ static int ci_hdrc_usb2_probe(struct platform_device *pdev)
*ci_pdata = ci_default_pdata;   /* struct copy */
}
 
-   match = of_match_device(ci_hdrc_usb2_of_match, >dev);
-   if (match && match->data) {
+   data = device_get_match_data(>dev);
+   if (data)
/* struct copy */
-   *ci_pdata = *(struct ci_hdrc_platform_data *)match->data;
-   }
+   *ci_pdata = *data;
 
priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
if (!priv)
diff --git a/drivers/usb/dwc2/params.c b/drivers/usb/dwc2/params.c
index 93f52e371cdd..fb03162ae9b7 100644
--- a/drivers/usb/dwc2/params.c
+++ b/drivers/usb/dwc2/params.c
@@ -5,7 +5,7 @@
 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -968,26 +968,17 @@ typedef void (*set_params_cb)(struct dwc2_hsotg *data);
 
 int dwc2_init_params(struct dwc2_hsotg *hsotg)
 {
-   const struct of_device_id *match;
set_params_cb set_params;
 
dwc2_set_default_params(hsotg);
dwc2_get_device_properties(hsotg);
 
-   match = of_match_device(dwc2_of_match_table, hsotg->dev);
-   if (match && match->data) {
-   set_params = match->data;
+   set_params = device_get_match_data(hsotg->dev);
+   if (set_params) {
set_params(hsotg);
-   } else if (!match) {
-   const struct acpi_device_id *amatch;
-   const struct pci_device_id *pmatch = NULL;
-
-   amatch = acpi_match_device(dwc2_acpi_match, hsotg->dev);
-   if (amatch && amatch->driver_data) {
-   set_params = (set_params_cb)amatch->driver_data;
-   set_params(hsotg);
-   } else if (!amatch)
-   pmatch = pci_match_id(dwc2_pci_ids, 
to_pci_dev(hsotg->dev->parent));
+   } else {
+   const struct pci_device_id *pmatch =
+   pci_match_id(dwc2_pci_ids, 
to_pci_dev(hsotg->dev->parent));
 
if (pmatch && pmatch->driver_data) {
set_params = (set_params_cb)pmatch->driver_data;
diff --git a/drivers/usb/gadget/udc/fsl_qe_udc.c 
b/drivers/usb/gadget/udc/fsl_qe_udc.c
index 4aae86b47edf..4e88681a79b6 100644
--- a/drivers/usb/gadget/udc/fsl_qe_udc.c
+++ b/drivers/usb/gadget/udc/fsl_qe_udc.c
@@ -27,9 +27,10 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -2471,17 +2472,12 @@ static const struct of_device_id qe_udc_match[];
 static int qe_udc_probe(struct platform_device *ofdev)
 {
struct qe_udc *udc;
-   const struct of_device_id *match;
struct device_node *np = ofdev->dev.of_node;
struct qe_ep *ep;
unsigned int ret = 0;
unsigned int i;
const void *prop;
 
-   match = of_match_device(qe_udc_match, >dev);
-   if (!match)
-   return -EINVAL;
-
prop = of_get_property(np, "mode", NULL);
if (!prop || strcmp(prop, "peripheral"))
return -ENODEV;
@@ -2493,7 +2489,7 @@ static int qe_udc_probe(struct platform_device *ofdev)
return -ENOMEM;
}
 
-   udc->soc_type = (unsigned long)match->data;
+   udc->soc_type = (unsigned long)device_get_match_data(>dev);
udc->usb_regs = of_iomap(np, 0);
if (!udc->usb_regs) {
ret = -ENOMEM;
diff --git a/drivers/usb/misc/onboard_usb_hub.c 
b/drivers/usb/misc/onboard_usb_hub.c
index 57bbe1309094..a341b2fbb7b4 100644
--- a/drivers/usb/mi

[PATCH net-next] net: ethernet: Use device_get_match_data()

2023-10-09 Thread Rob Herring
Use preferred device_get_match_data() instead of of_match_device() to
get the driver match data. With this, adjust the includes to explicitly
include the correct headers.

Signed-off-by: Rob Herring 
---
 drivers/net/ethernet/altera/altera_tse.h  |  2 +-
 drivers/net/ethernet/altera/altera_tse_main.c | 13 ++
 drivers/net/ethernet/amd/xgbe/xgbe-platform.c | 42 +--
 .../net/ethernet/apm/xgene/xgene_enet_main.c  | 15 +--
 .../net/ethernet/apm/xgene/xgene_enet_main.h  |  3 +-
 drivers/net/ethernet/freescale/fec_main.c | 12 +++---
 .../ethernet/freescale/fs_enet/fs_enet-main.c | 18 
 .../net/ethernet/freescale/fs_enet/mii-fec.c  | 10 ++---
 drivers/net/ethernet/freescale/fsl_pq_mdio.c  | 12 ++
 drivers/net/ethernet/hisilicon/hix5hd2_gmac.c | 11 ++---
 .../stmicro/stmmac/dwmac-intel-plat.c |  9 ++--
 drivers/net/ethernet/ti/davinci_emac.c| 12 ++
 drivers/net/ethernet/ti/icssg/icssg_prueth.c  | 13 ++
 13 files changed, 40 insertions(+), 132 deletions(-)

diff --git a/drivers/net/ethernet/altera/altera_tse.h 
b/drivers/net/ethernet/altera/altera_tse.h
index db5eed06e92d..82f2363a45cd 100644
--- a/drivers/net/ethernet/altera/altera_tse.h
+++ b/drivers/net/ethernet/altera/altera_tse.h
@@ -472,7 +472,7 @@ struct altera_tse_private {
/* ethtool msglvl option */
u32 msg_enable;
 
-   struct altera_dmaops *dmaops;
+   const struct altera_dmaops *dmaops;
 
struct phylink *phylink;
struct phylink_config phylink_config;
diff --git a/drivers/net/ethernet/altera/altera_tse_main.c 
b/drivers/net/ethernet/altera/altera_tse_main.c
index 1b1799985d1d..1c8763be0e4b 100644
--- a/drivers/net/ethernet/altera/altera_tse_main.c
+++ b/drivers/net/ethernet/altera/altera_tse_main.c
@@ -29,13 +29,13 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -82,8 +82,6 @@ MODULE_PARM_DESC(dma_tx_num, "Number of descriptors in the TX 
list");
 
 #define TXQUEUESTOP_THRESHHOLD 2
 
-static const struct of_device_id altera_tse_ids[];
-
 static inline u32 tse_tx_avail(struct altera_tse_private *priv)
 {
return priv->tx_cons + priv->tx_ring_size - priv->tx_prod - 1;
@@ -1133,7 +1131,6 @@ static int request_and_map(struct platform_device *pdev, 
const char *name,
  */
 static int altera_tse_probe(struct platform_device *pdev)
 {
-   const struct of_device_id *of_id = NULL;
struct regmap_config pcs_regmap_cfg;
struct altera_tse_private *priv;
struct mdio_regmap_config mrc;
@@ -1159,11 +1156,7 @@ static int altera_tse_probe(struct platform_device *pdev)
priv->dev = ndev;
priv->msg_enable = netif_msg_init(debug, default_msg_level);
 
-   of_id = of_match_device(altera_tse_ids, >dev);
-
-   if (of_id)
-   priv->dmaops = (struct altera_dmaops *)of_id->data;
-
+   priv->dmaops = device_get_match_data(>dev);
 
if (priv->dmaops &&
priv->dmaops->altera_dtype == ALTERA_DTYPE_SGDMA) {
diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-platform.c 
b/drivers/net/ethernet/amd/xgbe/xgbe-platform.c
index 91842a5e161b..9131020d06af 100644
--- a/drivers/net/ethernet/amd/xgbe/xgbe-platform.c
+++ b/drivers/net/ethernet/amd/xgbe/xgbe-platform.c
@@ -123,9 +123,7 @@
 #include 
 #include 
 #include 
-#include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -135,17 +133,6 @@
 #include "xgbe-common.h"
 
 #ifdef CONFIG_ACPI
-static const struct acpi_device_id xgbe_acpi_match[];
-
-static struct xgbe_version_data *xgbe_acpi_vdata(struct xgbe_prv_data *pdata)
-{
-   const struct acpi_device_id *id;
-
-   id = acpi_match_device(xgbe_acpi_match, pdata->dev);
-
-   return id ? (struct xgbe_version_data *)id->driver_data : NULL;
-}
-
 static int xgbe_acpi_support(struct xgbe_prv_data *pdata)
 {
struct device *dev = pdata->dev;
@@ -173,11 +160,6 @@ static int xgbe_acpi_support(struct xgbe_prv_data *pdata)
return 0;
 }
 #else   /* CONFIG_ACPI */
-static struct xgbe_version_data *xgbe_acpi_vdata(struct xgbe_prv_data *pdata)
-{
-   return NULL;
-}
-
 static int xgbe_acpi_support(struct xgbe_prv_data *pdata)
 {
return -EINVAL;
@@ -185,17 +167,6 @@ static int xgbe_acpi_support(struct xgbe_prv_data *pdata)
 #endif  /* CONFIG_ACPI */
 
 #ifdef CONFIG_OF
-static const struct of_device_id xgbe_of_match[];
-
-static struct xgbe_version_data *xgbe_of_vdata(struct xgbe_prv_data *pdata)
-{
-   const struct of_device_id *id;
-
-   id = of_match_device(xgbe_of_match, pdata->dev);
-
-   return id ? (struct xgbe_version_data *)id->data : NULL;
-}
-
 static int xgbe_of_support(struct xgbe_prv_data *pdata)
 {
struct device *dev = pdata->dev;
@@ -244,11 +215,6 @@ static struct platform_device *xgbe_of_get_phy_pdev(struct 
xgbe

[PATCH] powerpc: fsl_msi: Use device_get_match_data()

2023-10-06 Thread Rob Herring
Use preferred device_get_match_data() instead of of_match_device() to
get the driver match data. With this, adjust the includes to explicitly
include the correct headers.

Signed-off-by: Rob Herring 
---
 arch/powerpc/sysdev/fsl_msi.c | 10 --
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/arch/powerpc/sysdev/fsl_msi.c b/arch/powerpc/sysdev/fsl_msi.c
index 57978a44d55b..558ec68d768e 100644
--- a/arch/powerpc/sysdev/fsl_msi.c
+++ b/arch/powerpc/sysdev/fsl_msi.c
@@ -11,9 +11,11 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
-#include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -392,7 +394,6 @@ static int fsl_msi_setup_hwirq(struct fsl_msi *msi, struct 
platform_device *dev,
 static const struct of_device_id fsl_of_msi_ids[];
 static int fsl_of_msi_probe(struct platform_device *dev)
 {
-   const struct of_device_id *match;
struct fsl_msi *msi;
struct resource res, msiir;
int err, i, j, irq_index, count;
@@ -402,10 +403,7 @@ static int fsl_of_msi_probe(struct platform_device *dev)
u32 offset;
struct pci_controller *phb;
 
-   match = of_match_device(fsl_of_msi_ids, >dev);
-   if (!match)
-   return -EINVAL;
-   features = match->data;
+   features = device_get_match_data(>dev);
 
printk(KERN_DEBUG "Setting up Freescale MSI support\n");
 
-- 
2.40.1



[PATCH v3 3/5] ASoC: da7218: Use i2c_get_match_data()

2023-10-06 Thread Rob Herring
Use preferred i2c_get_match_data() instead of of_match_device() and
i2c_match_id() to get the driver match data. With this, adjust the
includes to explicitly include the correct headers.

Avoid using 0 for enum da7218_dev_id so that no match data can be
distinguished.

Signed-off-by: Rob Herring 
---
 sound/soc/codecs/da7218.c | 29 ++---
 sound/soc/codecs/da7218.h |  2 +-
 2 files changed, 3 insertions(+), 28 deletions(-)

diff --git a/sound/soc/codecs/da7218.c b/sound/soc/codecs/da7218.c
index 3f456b08b809..8aacd7350798 100644
--- a/sound/soc/codecs/da7218.c
+++ b/sound/soc/codecs/da7218.c
@@ -9,7 +9,7 @@
 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -2285,16 +2285,6 @@ static const struct of_device_id da7218_of_match[] = {
 };
 MODULE_DEVICE_TABLE(of, da7218_of_match);
 
-static inline int da7218_of_get_id(struct device *dev)
-{
-   const struct of_device_id *id = of_match_device(da7218_of_match, dev);
-
-   if (id)
-   return (uintptr_t)id->data;
-   else
-   return -EINVAL;
-}
-
 static enum da7218_micbias_voltage
da7218_of_micbias_lvl(struct snd_soc_component *component, u32 val)
 {
@@ -3253,18 +3243,6 @@ static const struct regmap_config da7218_regmap_config = 
{
  * I2C layer
  */
 
-static const struct i2c_device_id da7218_i2c_id[];
-
-static inline int da7218_i2c_get_id(struct i2c_client *i2c)
-{
-   const struct i2c_device_id *id = i2c_match_id(da7218_i2c_id, i2c);
-
-   if (id)
-   return (uintptr_t)id->driver_data;
-   else
-   return -EINVAL;
-}
-
 static int da7218_i2c_probe(struct i2c_client *i2c)
 {
struct da7218_priv *da7218;
@@ -3276,10 +3254,7 @@ static int da7218_i2c_probe(struct i2c_client *i2c)
 
i2c_set_clientdata(i2c, da7218);
 
-   if (i2c->dev.of_node)
-   da7218->dev_id = da7218_of_get_id(>dev);
-   else
-   da7218->dev_id = da7218_i2c_get_id(i2c);
+   da7218->dev_id = (uintptr_t)i2c_get_match_data(i2c);
 
if ((da7218->dev_id != DA7217_DEV_ID) &&
(da7218->dev_id != DA7218_DEV_ID)) {
diff --git a/sound/soc/codecs/da7218.h b/sound/soc/codecs/da7218.h
index 9ac2892092b5..7f6a4aea2c7a 100644
--- a/sound/soc/codecs/da7218.h
+++ b/sound/soc/codecs/da7218.h
@@ -1369,7 +1369,7 @@ enum da7218_sys_clk {
 };
 
 enum da7218_dev_id {
-   DA7217_DEV_ID = 0,
+   DA7217_DEV_ID = 1,
DA7218_DEV_ID,
 };
 

-- 
2.40.1



[PATCH v3 4/5] ASoC: qcom/lpass: Constify struct lpass_variant

2023-10-06 Thread Rob Herring
'struct lpass_variant' is used for driver match data which is supposed to
be constant. It's not modified anywhere, so it's just a matter of adding
'const' everywhere.

Signed-off-by: Rob Herring 
---
 sound/soc/qcom/lpass-apq8016.c  |  6 +++---
 sound/soc/qcom/lpass-cdc-dma.c  |  2 +-
 sound/soc/qcom/lpass-cpu.c  | 28 ++--
 sound/soc/qcom/lpass-ipq806x.c  |  2 +-
 sound/soc/qcom/lpass-platform.c | 36 ++--
 sound/soc/qcom/lpass-sc7180.c   |  6 +++---
 sound/soc/qcom/lpass-sc7280.c   |  6 +++---
 sound/soc/qcom/lpass.h  |  2 +-
 8 files changed, 44 insertions(+), 44 deletions(-)

diff --git a/sound/soc/qcom/lpass-apq8016.c b/sound/soc/qcom/lpass-apq8016.c
index f919d46e18ca..8ce75b442b64 100644
--- a/sound/soc/qcom/lpass-apq8016.c
+++ b/sound/soc/qcom/lpass-apq8016.c
@@ -123,7 +123,7 @@ static struct snd_soc_dai_driver 
apq8016_lpass_cpu_dai_driver[] = {
 static int apq8016_lpass_alloc_dma_channel(struct lpass_data *drvdata,
   int direction, unsigned int dai_id)
 {
-   struct lpass_variant *v = drvdata->variant;
+   const struct lpass_variant *v = drvdata->variant;
int chan = 0;
 
if (direction == SNDRV_PCM_STREAM_PLAYBACK) {
@@ -157,7 +157,7 @@ static int apq8016_lpass_free_dma_channel(struct lpass_data 
*drvdata, int chan,
 static int apq8016_lpass_init(struct platform_device *pdev)
 {
struct lpass_data *drvdata = platform_get_drvdata(pdev);
-   struct lpass_variant *variant = drvdata->variant;
+   const struct lpass_variant *variant = drvdata->variant;
struct device *dev = >dev;
int ret, i;
 
@@ -223,7 +223,7 @@ static int apq8016_lpass_exit(struct platform_device *pdev)
 }
 
 
-static struct lpass_variant apq8016_data = {
+static const struct lpass_variant apq8016_data = {
.i2sctrl_reg_base   = 0x1000,
.i2sctrl_reg_stride = 0x1000,
.i2s_ports  = 4,
diff --git a/sound/soc/qcom/lpass-cdc-dma.c b/sound/soc/qcom/lpass-cdc-dma.c
index 8221e2cbe35c..6389c7b6051e 100644
--- a/sound/soc/qcom/lpass-cdc-dma.c
+++ b/sound/soc/qcom/lpass-cdc-dma.c
@@ -37,7 +37,7 @@ static void __lpass_get_dmactl_handle(struct 
snd_pcm_substream *substream, struc
struct lpass_data *drvdata = snd_soc_dai_get_drvdata(dai);
struct snd_pcm_runtime *rt = substream->runtime;
struct lpass_pcm_data *pcm_data = rt->private_data;
-   struct lpass_variant *v = drvdata->variant;
+   const struct lpass_variant *v = drvdata->variant;
unsigned int dai_id = cpu_dai->driver->id;
 
switch (dai_id) {
diff --git a/sound/soc/qcom/lpass-cpu.c b/sound/soc/qcom/lpass-cpu.c
index 39571fed4001..18aff2654f89 100644
--- a/sound/soc/qcom/lpass-cpu.c
+++ b/sound/soc/qcom/lpass-cpu.c
@@ -44,7 +44,7 @@ static int lpass_cpu_init_i2sctl_bitfields(struct device *dev,
struct lpaif_i2sctl *i2sctl, struct regmap *map)
 {
struct lpass_data *drvdata = dev_get_drvdata(dev);
-   struct lpass_variant *v = drvdata->variant;
+   const struct lpass_variant *v = drvdata->variant;
 
i2sctl->loopback = devm_regmap_field_alloc(dev, map, v->loopback);
i2sctl->spken = devm_regmap_field_alloc(dev, map, v->spken);
@@ -463,7 +463,7 @@ static int asoc_qcom_of_xlate_dai_name(struct 
snd_soc_component *component,
   const char **dai_name)
 {
struct lpass_data *drvdata = snd_soc_component_get_drvdata(component);
-   struct lpass_variant *variant = drvdata->variant;
+   const struct lpass_variant *variant = drvdata->variant;
int id = args->args[0];
int ret = -EINVAL;
int i;
@@ -488,7 +488,7 @@ static const struct snd_soc_component_driver 
lpass_cpu_comp_driver = {
 static bool lpass_cpu_regmap_writeable(struct device *dev, unsigned int reg)
 {
struct lpass_data *drvdata = dev_get_drvdata(dev);
-   struct lpass_variant *v = drvdata->variant;
+   const struct lpass_variant *v = drvdata->variant;
int i;
 
for (i = 0; i < v->i2s_ports; ++i)
@@ -530,7 +530,7 @@ static bool lpass_cpu_regmap_writeable(struct device *dev, 
unsigned int reg)
 static bool lpass_cpu_regmap_readable(struct device *dev, unsigned int reg)
 {
struct lpass_data *drvdata = dev_get_drvdata(dev);
-   struct lpass_variant *v = drvdata->variant;
+   const struct lpass_variant *v = drvdata->variant;
int i;
 
for (i = 0; i < v->i2s_ports; ++i)
@@ -578,7 +578,7 @@ static bool lpass_cpu_regmap_readable(struct device *dev, 
unsigned int reg)
 static bool lpass_cpu_regmap_volatile(struct device *dev, unsigned int reg)
 {
struct lpass_data *drvdata = dev_get_drvdata(dev);
-   struct lpass_variant *v = drvdata->variant;
+   const struct lpass_variant *v = drvdata->variant;
int i;
 
  

[PATCH v3 5/5] ASoC: Use device_get_match_data()

2023-10-06 Thread Rob Herring
Use preferred device_get_match_data() instead of of_match_device() to
get the driver match data. With this, adjust the includes to explicitly
include the correct headers.

Signed-off-by: Rob Herring 
---
v3:
 - Move some header changes from patch 1 to here for rockchip_i2s_tdm.c,
   rockchip_pdm.c, smdk_wm8994.c, and tegra210_amx.c.
---
 sound/soc/intel/keembay/kmb_platform.c | 13 +
 sound/soc/qcom/lpass-cpu.c | 15 +--
 sound/soc/rockchip/rockchip_i2s.c  |  8 +++-
 sound/soc/rockchip/rockchip_i2s_tdm.c  | 24 
 sound/soc/rockchip/rockchip_pdm.c  |  7 +--
 sound/soc/samsung/smdk_wm8994.c| 28 +++-
 sound/soc/stm/stm32_i2s.c  |  7 ++-
 sound/soc/stm/stm32_sai.c  |  8 
 sound/soc/stm/stm32_sai_sub.c  |  6 +-
 sound/soc/stm/stm32_spdifrx.c  |  8 ++--
 sound/soc/tegra/tegra210_amx.c | 10 ++
 sound/soc/ti/davinci-evm.c |  7 ++-
 sound/soc/ti/davinci-mcasp.c   |  9 -
 sound/soc/ti/omap-mcbsp.c  | 10 --
 14 files changed, 42 insertions(+), 118 deletions(-)

diff --git a/sound/soc/intel/keembay/kmb_platform.c 
b/sound/soc/intel/keembay/kmb_platform.c
index e929497a5eb5..37ea2e1d2e92 100644
--- a/sound/soc/intel/keembay/kmb_platform.c
+++ b/sound/soc/intel/keembay/kmb_platform.c
@@ -11,7 +11,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -820,7 +819,6 @@ static int kmb_plat_dai_probe(struct platform_device *pdev)
 {
struct device_node *np = pdev->dev.of_node;
struct snd_soc_dai_driver *kmb_i2s_dai;
-   const struct of_device_id *match;
struct device *dev = >dev;
struct kmb_i2s_info *kmb_i2s;
struct resource *res;
@@ -831,16 +829,7 @@ static int kmb_plat_dai_probe(struct platform_device *pdev)
if (!kmb_i2s)
return -ENOMEM;
 
-   kmb_i2s_dai = devm_kzalloc(dev, sizeof(*kmb_i2s_dai), GFP_KERNEL);
-   if (!kmb_i2s_dai)
-   return -ENOMEM;
-
-   match = of_match_device(kmb_plat_of_match, >dev);
-   if (!match) {
-   dev_err(>dev, "Error: No device match found\n");
-   return -ENODEV;
-   }
-   kmb_i2s_dai = (struct snd_soc_dai_driver *) match->data;
+   kmb_i2s_dai = (struct snd_soc_dai_driver 
*)device_get_match_data(>dev);
 
/* Prepare the related clocks */
kmb_i2s->clk_apb = devm_clk_get(dev, "apb_clk");
diff --git a/sound/soc/qcom/lpass-cpu.c b/sound/soc/qcom/lpass-cpu.c
index 18aff2654f89..ac0feb89b458 100644
--- a/sound/soc/qcom/lpass-cpu.c
+++ b/sound/soc/qcom/lpass-cpu.c
@@ -9,7 +9,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -1106,7 +1105,6 @@ int asoc_qcom_lpass_cpu_platform_probe(struct 
platform_device *pdev)
struct resource *res;
const struct lpass_variant *variant;
struct device *dev = >dev;
-   const struct of_device_id *match;
int ret, i, dai_id;
 
dsp_of_node = of_parse_phandle(pdev->dev.of_node, "qcom,adsp", 0);
@@ -1121,17 +1119,14 @@ int asoc_qcom_lpass_cpu_platform_probe(struct 
platform_device *pdev)
return -ENOMEM;
platform_set_drvdata(pdev, drvdata);
 
-   match = of_match_device(dev->driver->of_match_table, dev);
-   if (!match || !match->data)
+   variant = device_get_match_data(dev);
+   if (!variant)
return -EINVAL;
 
-   if (of_device_is_compatible(dev->of_node, "qcom,lpass-cpu-apq8016")) {
-   dev_warn(dev, "%s compatible is deprecated\n",
-match->compatible);
-   }
+   if (of_device_is_compatible(dev->of_node, "qcom,lpass-cpu-apq8016"))
+   dev_warn(dev, "qcom,lpass-cpu-apq8016 compatible is 
deprecated\n");
 
-   drvdata->variant = (struct lpass_variant *)match->data;
-   variant = drvdata->variant;
+   drvdata->variant = variant;
 
of_lpass_cpu_parse_dai_data(dev, drvdata);
 
diff --git a/sound/soc/rockchip/rockchip_i2s.c 
b/sound/soc/rockchip/rockchip_i2s.c
index 74e7d6ee0f28..b0c3ef030e06 100644
--- a/sound/soc/rockchip/rockchip_i2s.c
+++ b/sound/soc/rockchip/rockchip_i2s.c
@@ -10,8 +10,8 @@
 #include 
 #include 
 #include 
+#include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -736,7 +736,6 @@ static int rockchip_i2s_init_dai(struct rk_i2s_dev *i2s, 
struct resource *res,
 static int rockchip_i2s_probe(struct platform_device *pdev)
 {
struct device_node *node = pdev->dev.of_node;
-   const struct of_device_id *of_id;
struct rk_i2s_dev *i2s;
struct snd_soc_dai_driver *dai;
struct resource *res;
@@ -752,11 +751,10 @@ static int rockchip_i2s_probe(struct platform_device 
*pdev)

[PATCH v3 2/5] ASoC: Drop unnecessary of_match_device() calls

2023-10-06 Thread Rob Herring
If probe is reached, we've already matched the device and in the case of
DT matching, the struct device_node pointer will be set. Therefore, there
is no need to call of_match_device() in probe.

Acked-by: Charles Keepax 
Signed-off-by: Rob Herring 
---
 sound/soc/codecs/ak5386.c  |  7 ++-
 sound/soc/codecs/cs4271.c  | 22 ++
 sound/soc/codecs/tas5086.c |  6 +-
 3 files changed, 9 insertions(+), 26 deletions(-)

diff --git a/sound/soc/codecs/ak5386.c b/sound/soc/codecs/ak5386.c
index 0c5e00679c7d..21a44476f48d 100644
--- a/sound/soc/codecs/ak5386.c
+++ b/sound/soc/codecs/ak5386.c
@@ -10,7 +10,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -168,7 +167,6 @@ static int ak5386_probe(struct platform_device *pdev)
if (!priv)
return -ENOMEM;
 
-   priv->reset_gpio = -EINVAL;
dev_set_drvdata(dev, priv);
 
for (i = 0; i < ARRAY_SIZE(supply_names); i++)
@@ -179,9 +177,8 @@ static int ak5386_probe(struct platform_device *pdev)
if (ret < 0)
return ret;
 
-   if (of_match_device(of_match_ptr(ak5386_dt_ids), dev))
-   priv->reset_gpio = of_get_named_gpio(dev->of_node,
- "reset-gpio", 0);
+   priv->reset_gpio = of_get_named_gpio(dev->of_node,
+"reset-gpio", 0);
 
if (gpio_is_valid(priv->reset_gpio))
if (devm_gpio_request_one(dev, priv->reset_gpio,
diff --git a/sound/soc/codecs/cs4271.c b/sound/soc/codecs/cs4271.c
index 188b8b43c524..9e6f8a048dd5 100644
--- a/sound/soc/codecs/cs4271.c
+++ b/sound/soc/codecs/cs4271.c
@@ -15,7 +15,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -563,19 +562,12 @@ static int cs4271_component_probe(struct 
snd_soc_component *component)
struct cs4271_private *cs4271 = 
snd_soc_component_get_drvdata(component);
struct cs4271_platform_data *cs4271plat = component->dev->platform_data;
int ret;
-   bool amutec_eq_bmutec = false;
+   bool amutec_eq_bmutec;
 
-#ifdef CONFIG_OF
-   if (of_match_device(cs4271_dt_ids, component->dev)) {
-   if (of_get_property(component->dev->of_node,
-"cirrus,amutec-eq-bmutec", NULL))
-   amutec_eq_bmutec = true;
-
-   if (of_get_property(component->dev->of_node,
-"cirrus,enable-soft-reset", NULL))
-   cs4271->enable_soft_reset = true;
-   }
-#endif
+   amutec_eq_bmutec = of_property_read_bool(component->dev->of_node,
+"cirrus,amutec-eq-bmutec");
+   cs4271->enable_soft_reset = 
of_property_read_bool(component->dev->of_node,
+ 
"cirrus,enable-soft-reset");
 
ret = regulator_bulk_enable(ARRAY_SIZE(cs4271->supplies),
cs4271->supplies);
@@ -655,9 +647,7 @@ static int cs4271_common_probe(struct device *dev,
if (!cs4271)
return -ENOMEM;
 
-   if (of_match_device(cs4271_dt_ids, dev))
-   cs4271->gpio_nreset =
-   of_get_named_gpio(dev->of_node, "reset-gpio", 0);
+   cs4271->gpio_nreset = of_get_named_gpio(dev->of_node, "reset-gpio", 0);
 
if (cs4271plat)
cs4271->gpio_nreset = cs4271plat->gpio_nreset;
diff --git a/sound/soc/codecs/tas5086.c b/sound/soc/codecs/tas5086.c
index 60e59e993ba6..f52c14b43f28 100644
--- a/sound/soc/codecs/tas5086.c
+++ b/sound/soc/codecs/tas5086.c
@@ -940,11 +940,7 @@ static int tas5086_i2c_probe(struct i2c_client *i2c)
 
i2c_set_clientdata(i2c, priv);
 
-   if (of_match_device(of_match_ptr(tas5086_dt_ids), dev)) {
-   struct device_node *of_node = dev->of_node;
-   gpio_nreset = of_get_named_gpio(of_node, "reset-gpio", 0);
-   }
-
+   gpio_nreset = of_get_named_gpio(dev->of_node, "reset-gpio", 0);
if (gpio_is_valid(gpio_nreset))
if (devm_gpio_request(dev, gpio_nreset, "TAS5086 Reset"))
gpio_nreset = -EINVAL;

-- 
2.40.1



[PATCH v3 1/5] ASoC: Explicitly include correct DT includes

2023-10-06 Thread Rob Herring
The DT of_device.h and of_platform.h date back to the separate
of_platform_bus_type before it was merged into the regular platform bus.
As part of that merge prepping Arm DT support 13 years ago, they
"temporarily" include each other. They also include platform_device.h
and of.h. As a result, there's a pretty much random mix of those include
files used throughout the tree. In order to detangle these headers and
replace the implicit includes with struct declarations, users need to
explicitly include the correct includes.

Acked-by: Jernej Skrabec 
Reviewed-by: AngeloGioacchino Del Regno 

Acked-by: Charles Keepax 
Reviewed-by: Claudiu Beznea  # for at91
Signed-off-by: Rob Herring 
---
v3:
 - Move some header changes to patch 5
---
 sound/soc/atmel/atmel_wm8904.c | 1 -
 sound/soc/atmel/mchp-i2s-mcc.c | 2 +-
 sound/soc/atmel/tse850-pcm5142.c   | 1 -
 sound/soc/bcm/cygnus-ssp.c | 2 +-
 sound/soc/codecs/adau1701.c| 1 -
 sound/soc/codecs/adau1977-spi.c| 1 -
 sound/soc/codecs/ak4104.c  | 2 +-
 sound/soc/codecs/ak4118.c  | 2 +-
 sound/soc/codecs/ak4375.c  | 2 +-
 sound/soc/codecs/ak4458.c  | 2 +-
 sound/soc/codecs/ak4613.c  | 2 +-
 sound/soc/codecs/ak4642.c  | 2 +-
 sound/soc/codecs/ak5558.c  | 2 +-
 sound/soc/codecs/cs35l32.c | 2 +-
 sound/soc/codecs/cs35l33.c | 2 --
 sound/soc/codecs/cs35l34.c | 2 +-
 sound/soc/codecs/cs35l35.c | 3 +--
 sound/soc/codecs/cs35l36.c | 3 +--
 sound/soc/codecs/cs35l41-i2c.c | 2 +-
 sound/soc/codecs/cs35l41.c | 1 -
 sound/soc/codecs/cs4270.c  | 2 +-
 sound/soc/codecs/cs42l42.c | 1 -
 sound/soc/codecs/cs42l56.c | 2 +-
 sound/soc/codecs/cs42xx8-i2c.c | 2 +-
 sound/soc/codecs/cs43130.c | 3 +--
 sound/soc/codecs/cs4349.c  | 2 +-
 sound/soc/codecs/da7213.c  | 2 +-
 sound/soc/codecs/da7219.c  | 2 +-
 sound/soc/codecs/da9055.c  | 1 -
 sound/soc/codecs/es8328.c  | 1 -
 sound/soc/codecs/gtm601.c  | 2 +-
 sound/soc/codecs/lpass-macro-common.c  | 2 +-
 sound/soc/codecs/mt6351.c  | 2 +-
 sound/soc/codecs/mt6358.c  | 2 +-
 sound/soc/codecs/mt6359-accdet.c   | 4 
 sound/soc/codecs/mt6359.c  | 2 +-
 sound/soc/codecs/nau8540.c | 2 +-
 sound/soc/codecs/pcm1681.c | 2 --
 sound/soc/codecs/rt715.c   | 2 --
 sound/soc/codecs/sgtl5000.c| 2 +-
 sound/soc/codecs/sma1303.c | 2 +-
 sound/soc/codecs/sta32x.c  | 3 +--
 sound/soc/codecs/sta350.c  | 3 +--
 sound/soc/codecs/tas571x.c | 2 +-
 sound/soc/codecs/uda1334.c | 2 +-
 sound/soc/codecs/wm8510.c  | 2 +-
 sound/soc/codecs/wm8523.c  | 2 +-
 sound/soc/codecs/wm8524.c  | 2 +-
 sound/soc/codecs/wm8580.c  | 2 +-
 sound/soc/codecs/wm8711.c  | 2 +-
 sound/soc/codecs/wm8728.c  | 2 +-
 sound/soc/codecs/wm8731-i2c.c  | 2 +-
 sound/soc/codecs/wm8731-spi.c  | 2 +-
 sound/soc/codecs/wm8737.c  | 2 +-
 sound/soc/codecs/wm8741.c  | 2 +-
 sound/soc/codecs/wm8750.c  | 2 +-
 sound/soc/codecs/wm8753.c  | 2 +-
 sound/soc/codecs/wm8770.c  | 2 +-
 sound/soc/codecs/wm8776.c  | 2 +-
 sound/soc/codecs/wm8804.c  | 1 -
 sound/soc/fsl/efika-audio-fabric.c | 4 ++--
 sound/soc/fsl/fsl_aud2htx.c| 3 +--
 sound/soc/fsl/fsl_mqs.c| 2 +-
 sound/soc/fsl/f

[PATCH v3 0/5] ASoC: DT matching and header cleanups

2023-10-06 Thread Rob Herring
(trimmed the recipient list due to bounces on v1)

This is a series is part of ongoing clean-ups related to device 
matching and DT related implicit includes. Essentially of_device.h has 
a bunch of implicit includes and generally isn't needed any nore except 
for of_match_device(). As we also generally want to get rid of 
of_match_device() as well, I've done that so we're not updating the 
includes twice.

Signed-off-by: Rob Herring 
---
Changes in v3:
- Move some include changes from patch #1 to #5 to fix build with just 
  patch #1 applied.
- Link to v2: 
https://lore.kernel.org/r/20231004-dt-asoc-header-cleanups-v2-0-e77765080...@kernel.org

Changes in v2:
- Add tags
- Link to v1: 
https://lore.kernel.org/r/20231003-dt-asoc-header-cleanups-v1-0-308666806...@kernel.org
- Link to v1 resend: 
https://lore.kernel.org/r/20231003-dt-asoc-header-cleanups-v1-0-05b5d6447...@kernel.org/

---
Rob Herring (5):
  ASoC: Explicitly include correct DT includes
  ASoC: Drop unnecessary of_match_device() calls
  ASoC: da7218: Use i2c_get_match_data()
  ASoC: qcom/lpass: Constify struct lpass_variant
  ASoC: Use device_get_match_data()

 sound/soc/atmel/atmel_wm8904.c |  1 -
 sound/soc/atmel/mchp-i2s-mcc.c |  2 +-
 sound/soc/atmel/tse850-pcm5142.c   |  1 -
 sound/soc/bcm/cygnus-ssp.c |  2 +-
 sound/soc/codecs/adau1701.c|  1 -
 sound/soc/codecs/adau1977-spi.c|  1 -
 sound/soc/codecs/ak4104.c  |  2 +-
 sound/soc/codecs/ak4118.c  |  2 +-
 sound/soc/codecs/ak4375.c  |  2 +-
 sound/soc/codecs/ak4458.c  |  2 +-
 sound/soc/codecs/ak4613.c  |  2 +-
 sound/soc/codecs/ak4642.c  |  2 +-
 sound/soc/codecs/ak5386.c  |  7 +---
 sound/soc/codecs/ak5558.c  |  2 +-
 sound/soc/codecs/cs35l32.c |  2 +-
 sound/soc/codecs/cs35l33.c |  2 -
 sound/soc/codecs/cs35l34.c |  2 +-
 sound/soc/codecs/cs35l35.c |  3 +-
 sound/soc/codecs/cs35l36.c |  3 +-
 sound/soc/codecs/cs35l41-i2c.c |  2 +-
 sound/soc/codecs/cs35l41.c |  1 -
 sound/soc/codecs/cs4270.c  |  2 +-
 sound/soc/codecs/cs4271.c  | 22 +++
 sound/soc/codecs/cs42l42.c |  1 -
 sound/soc/codecs/cs42l56.c |  2 +-
 sound/soc/codecs/cs42xx8-i2c.c |  2 +-
 sound/soc/codecs/cs43130.c |  3 +-
 sound/soc/codecs/cs4349.c  |  2 +-
 sound/soc/codecs/da7213.c  |  2 +-
 sound/soc/codecs/da7218.c  | 29 +--
 sound/soc/codecs/da7218.h  |  2 +-
 sound/soc/codecs/da7219.c  |  2 +-
 sound/soc/codecs/da9055.c  |  1 -
 sound/soc/codecs/es8328.c  |  1 -
 sound/soc/codecs/gtm601.c  |  2 +-
 sound/soc/codecs/lpass-macro-common.c  |  2 +-
 sound/soc/codecs/mt6351.c  |  2 +-
 sound/soc/codecs/mt6358.c  |  2 +-
 sound/soc/codecs/mt6359-accdet.c   |  4 --
 sound/soc/codecs/mt6359.c  |  2 +-
 sound/soc/codecs/nau8540.c |  2 +-
 sound/soc/codecs/pcm1681.c |  2 -
 sound/soc/codecs/rt715.c   |  2 -
 sound/soc/codecs/sgtl5000.c|  2 +-
 sound/soc/codecs/sma1303.c |  2 +-
 sound/soc/codecs/sta32x.c  |  3 +-
 sound/soc/codecs/sta350.c  |  3 +-
 sound/soc/codecs/tas5086.c |  6 +--
 sound/soc/codecs/tas571x.c |  2 +-
 sound/soc/codecs/uda1334.c |  2 +-
 sound/soc/codecs/wm8510.c  |  2 +-
 sound/soc/codecs/wm8523.c  |  2 +-
 sound/soc/codecs/wm8524.c  |  2 +-
 sound/soc/codecs/wm8580.c  |  2 +-
 sound/soc/codecs/wm8711.c  |  2 +-
 sound/soc/codecs/wm8728.c  |  2 +-
 sound/soc/codecs/wm8731-i2c.c  |  2 +-
 sound/soc/codecs/wm8731-spi.c  |  2 +-
 sound/soc/codecs/wm8737.c  |  2 +-
 sound/soc/codecs/wm8741.c  |  2 +-
 sound/soc/codecs/wm8750.c  |  2 +-
 sound/soc/codecs/wm8753.c  |  2 +-
 sound/soc/codecs/wm8770.c  |  2 +-
 sound/soc/codecs/wm8776.c

Re: [PATCH v2 1/5] ASoC: Explicitly include correct DT includes

2023-10-04 Thread Rob Herring
On Wed, Oct 4, 2023 at 12:39 PM Mark Brown  wrote:
>
> On Wed, Oct 04, 2023 at 10:58:05AM -0500, Rob Herring wrote:
> > The DT of_device.h and of_platform.h date back to the separate
> > of_platform_bus_type before it was merged into the regular platform bus.
> > As part of that merge prepping Arm DT support 13 years ago, they
> > "temporarily" include each other. They also include platform_device.h
> > and of.h. As a result, there's a pretty much random mix of those include
> > files used throughout the tree. In order to detangle these headers and
> > replace the implicit includes with struct declarations, users need to
> > explicitly include the correct includes.
>
> This is breaking various builds for me, for example arm64 defconfig:

I believe I got some of the include changes in the wrong place. They
should go into patch 5.

Rob


[PATCH v2 3/5] ASoC: da7218: Use i2c_get_match_data()

2023-10-04 Thread Rob Herring
Use preferred i2c_get_match_data() instead of of_match_device() and
i2c_match_id() to get the driver match data. With this, adjust the
includes to explicitly include the correct headers.

Avoid using 0 for enum da7218_dev_id so that no match data can be
distinguished.

Signed-off-by: Rob Herring 
---
 sound/soc/codecs/da7218.c | 29 ++---
 sound/soc/codecs/da7218.h |  2 +-
 2 files changed, 3 insertions(+), 28 deletions(-)

diff --git a/sound/soc/codecs/da7218.c b/sound/soc/codecs/da7218.c
index 3f456b08b809..8aacd7350798 100644
--- a/sound/soc/codecs/da7218.c
+++ b/sound/soc/codecs/da7218.c
@@ -9,7 +9,7 @@
 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -2285,16 +2285,6 @@ static const struct of_device_id da7218_of_match[] = {
 };
 MODULE_DEVICE_TABLE(of, da7218_of_match);
 
-static inline int da7218_of_get_id(struct device *dev)
-{
-   const struct of_device_id *id = of_match_device(da7218_of_match, dev);
-
-   if (id)
-   return (uintptr_t)id->data;
-   else
-   return -EINVAL;
-}
-
 static enum da7218_micbias_voltage
da7218_of_micbias_lvl(struct snd_soc_component *component, u32 val)
 {
@@ -3253,18 +3243,6 @@ static const struct regmap_config da7218_regmap_config = 
{
  * I2C layer
  */
 
-static const struct i2c_device_id da7218_i2c_id[];
-
-static inline int da7218_i2c_get_id(struct i2c_client *i2c)
-{
-   const struct i2c_device_id *id = i2c_match_id(da7218_i2c_id, i2c);
-
-   if (id)
-   return (uintptr_t)id->driver_data;
-   else
-   return -EINVAL;
-}
-
 static int da7218_i2c_probe(struct i2c_client *i2c)
 {
struct da7218_priv *da7218;
@@ -3276,10 +3254,7 @@ static int da7218_i2c_probe(struct i2c_client *i2c)
 
i2c_set_clientdata(i2c, da7218);
 
-   if (i2c->dev.of_node)
-   da7218->dev_id = da7218_of_get_id(>dev);
-   else
-   da7218->dev_id = da7218_i2c_get_id(i2c);
+   da7218->dev_id = (uintptr_t)i2c_get_match_data(i2c);
 
if ((da7218->dev_id != DA7217_DEV_ID) &&
(da7218->dev_id != DA7218_DEV_ID)) {
diff --git a/sound/soc/codecs/da7218.h b/sound/soc/codecs/da7218.h
index 9ac2892092b5..7f6a4aea2c7a 100644
--- a/sound/soc/codecs/da7218.h
+++ b/sound/soc/codecs/da7218.h
@@ -1369,7 +1369,7 @@ enum da7218_sys_clk {
 };
 
 enum da7218_dev_id {
-   DA7217_DEV_ID = 0,
+   DA7217_DEV_ID = 1,
DA7218_DEV_ID,
 };
 

-- 
2.40.1



[PATCH v2 1/5] ASoC: Explicitly include correct DT includes

2023-10-04 Thread Rob Herring
The DT of_device.h and of_platform.h date back to the separate
of_platform_bus_type before it was merged into the regular platform bus.
As part of that merge prepping Arm DT support 13 years ago, they
"temporarily" include each other. They also include platform_device.h
and of.h. As a result, there's a pretty much random mix of those include
files used throughout the tree. In order to detangle these headers and
replace the implicit includes with struct declarations, users need to
explicitly include the correct includes.

Acked-by: Jernej Skrabec 
Reviewed-by: AngeloGioacchino Del Regno 

Acked-by: Charles Keepax 
Signed-off-by: Rob Herring 
---
 sound/soc/atmel/atmel_wm8904.c | 1 -
 sound/soc/atmel/mchp-i2s-mcc.c | 2 +-
 sound/soc/atmel/tse850-pcm5142.c   | 1 -
 sound/soc/bcm/cygnus-ssp.c | 2 +-
 sound/soc/codecs/adau1701.c| 1 -
 sound/soc/codecs/adau1977-spi.c| 1 -
 sound/soc/codecs/ak4104.c  | 2 +-
 sound/soc/codecs/ak4118.c  | 2 +-
 sound/soc/codecs/ak4375.c  | 2 +-
 sound/soc/codecs/ak4458.c  | 2 +-
 sound/soc/codecs/ak4613.c  | 2 +-
 sound/soc/codecs/ak4642.c  | 2 +-
 sound/soc/codecs/ak5558.c  | 2 +-
 sound/soc/codecs/cs35l32.c | 2 +-
 sound/soc/codecs/cs35l33.c | 2 --
 sound/soc/codecs/cs35l34.c | 2 +-
 sound/soc/codecs/cs35l35.c | 3 +--
 sound/soc/codecs/cs35l36.c | 3 +--
 sound/soc/codecs/cs35l41-i2c.c | 2 +-
 sound/soc/codecs/cs35l41.c | 1 -
 sound/soc/codecs/cs4270.c  | 2 +-
 sound/soc/codecs/cs42l42.c | 1 -
 sound/soc/codecs/cs42l56.c | 2 +-
 sound/soc/codecs/cs42xx8-i2c.c | 2 +-
 sound/soc/codecs/cs43130.c | 3 +--
 sound/soc/codecs/cs4349.c  | 2 +-
 sound/soc/codecs/da7213.c  | 2 +-
 sound/soc/codecs/da7219.c  | 2 +-
 sound/soc/codecs/da9055.c  | 1 -
 sound/soc/codecs/es8328.c  | 1 -
 sound/soc/codecs/gtm601.c  | 2 +-
 sound/soc/codecs/lpass-macro-common.c  | 2 +-
 sound/soc/codecs/mt6351.c  | 2 +-
 sound/soc/codecs/mt6358.c  | 2 +-
 sound/soc/codecs/mt6359-accdet.c   | 4 
 sound/soc/codecs/mt6359.c  | 2 +-
 sound/soc/codecs/nau8540.c | 2 +-
 sound/soc/codecs/pcm1681.c | 2 --
 sound/soc/codecs/rt715.c   | 2 --
 sound/soc/codecs/sgtl5000.c| 2 +-
 sound/soc/codecs/sma1303.c | 2 +-
 sound/soc/codecs/sta32x.c  | 3 +--
 sound/soc/codecs/sta350.c  | 3 +--
 sound/soc/codecs/tas571x.c | 2 +-
 sound/soc/codecs/uda1334.c | 2 +-
 sound/soc/codecs/wm8510.c  | 2 +-
 sound/soc/codecs/wm8523.c  | 2 +-
 sound/soc/codecs/wm8524.c  | 2 +-
 sound/soc/codecs/wm8580.c  | 2 +-
 sound/soc/codecs/wm8711.c  | 2 +-
 sound/soc/codecs/wm8728.c  | 2 +-
 sound/soc/codecs/wm8731-i2c.c  | 2 +-
 sound/soc/codecs/wm8731-spi.c  | 2 +-
 sound/soc/codecs/wm8737.c  | 2 +-
 sound/soc/codecs/wm8741.c  | 2 +-
 sound/soc/codecs/wm8750.c  | 2 +-
 sound/soc/codecs/wm8753.c  | 2 +-
 sound/soc/codecs/wm8770.c  | 2 +-
 sound/soc/codecs/wm8776.c  | 2 +-
 sound/soc/codecs/wm8804.c  | 1 -
 sound/soc/fsl/efika-audio-fabric.c | 4 ++--
 sound/soc/fsl/fsl_aud2htx.c| 3 +--
 sound/soc/fsl/fsl_mqs.c| 2 +-
 sound/soc/fsl/fsl_rpmsg.c  | 3 +--
 sound/soc/fsl

[PATCH v2 5/5] ASoC: Use device_get_match_data()

2023-10-04 Thread Rob Herring
Use preferred device_get_match_data() instead of of_match_device() to
get the driver match data. With this, adjust the includes to explicitly
include the correct headers.

Signed-off-by: Rob Herring 
---
 sound/soc/intel/keembay/kmb_platform.c | 13 +
 sound/soc/qcom/lpass-cpu.c | 15 +--
 sound/soc/rockchip/rockchip_i2s.c  |  8 +++-
 sound/soc/rockchip/rockchip_i2s_tdm.c  | 20 +++-
 sound/soc/rockchip/rockchip_pdm.c  |  6 +-
 sound/soc/samsung/smdk_wm8994.c| 27 +++
 sound/soc/stm/stm32_i2s.c  |  7 ++-
 sound/soc/stm/stm32_sai.c  |  8 
 sound/soc/stm/stm32_sai_sub.c  |  6 +-
 sound/soc/stm/stm32_spdifrx.c  |  8 ++--
 sound/soc/tegra/tegra210_amx.c |  7 +--
 sound/soc/ti/davinci-evm.c |  7 ++-
 sound/soc/ti/davinci-mcasp.c   |  9 -
 sound/soc/ti/omap-mcbsp.c  | 10 --
 14 files changed, 40 insertions(+), 111 deletions(-)

diff --git a/sound/soc/intel/keembay/kmb_platform.c 
b/sound/soc/intel/keembay/kmb_platform.c
index e929497a5eb5..37ea2e1d2e92 100644
--- a/sound/soc/intel/keembay/kmb_platform.c
+++ b/sound/soc/intel/keembay/kmb_platform.c
@@ -11,7 +11,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -820,7 +819,6 @@ static int kmb_plat_dai_probe(struct platform_device *pdev)
 {
struct device_node *np = pdev->dev.of_node;
struct snd_soc_dai_driver *kmb_i2s_dai;
-   const struct of_device_id *match;
struct device *dev = >dev;
struct kmb_i2s_info *kmb_i2s;
struct resource *res;
@@ -831,16 +829,7 @@ static int kmb_plat_dai_probe(struct platform_device *pdev)
if (!kmb_i2s)
return -ENOMEM;
 
-   kmb_i2s_dai = devm_kzalloc(dev, sizeof(*kmb_i2s_dai), GFP_KERNEL);
-   if (!kmb_i2s_dai)
-   return -ENOMEM;
-
-   match = of_match_device(kmb_plat_of_match, >dev);
-   if (!match) {
-   dev_err(>dev, "Error: No device match found\n");
-   return -ENODEV;
-   }
-   kmb_i2s_dai = (struct snd_soc_dai_driver *) match->data;
+   kmb_i2s_dai = (struct snd_soc_dai_driver 
*)device_get_match_data(>dev);
 
/* Prepare the related clocks */
kmb_i2s->clk_apb = devm_clk_get(dev, "apb_clk");
diff --git a/sound/soc/qcom/lpass-cpu.c b/sound/soc/qcom/lpass-cpu.c
index 18aff2654f89..ac0feb89b458 100644
--- a/sound/soc/qcom/lpass-cpu.c
+++ b/sound/soc/qcom/lpass-cpu.c
@@ -9,7 +9,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -1106,7 +1105,6 @@ int asoc_qcom_lpass_cpu_platform_probe(struct 
platform_device *pdev)
struct resource *res;
const struct lpass_variant *variant;
struct device *dev = >dev;
-   const struct of_device_id *match;
int ret, i, dai_id;
 
dsp_of_node = of_parse_phandle(pdev->dev.of_node, "qcom,adsp", 0);
@@ -1121,17 +1119,14 @@ int asoc_qcom_lpass_cpu_platform_probe(struct 
platform_device *pdev)
return -ENOMEM;
platform_set_drvdata(pdev, drvdata);
 
-   match = of_match_device(dev->driver->of_match_table, dev);
-   if (!match || !match->data)
+   variant = device_get_match_data(dev);
+   if (!variant)
return -EINVAL;
 
-   if (of_device_is_compatible(dev->of_node, "qcom,lpass-cpu-apq8016")) {
-   dev_warn(dev, "%s compatible is deprecated\n",
-match->compatible);
-   }
+   if (of_device_is_compatible(dev->of_node, "qcom,lpass-cpu-apq8016"))
+   dev_warn(dev, "qcom,lpass-cpu-apq8016 compatible is 
deprecated\n");
 
-   drvdata->variant = (struct lpass_variant *)match->data;
-   variant = drvdata->variant;
+   drvdata->variant = variant;
 
of_lpass_cpu_parse_dai_data(dev, drvdata);
 
diff --git a/sound/soc/rockchip/rockchip_i2s.c 
b/sound/soc/rockchip/rockchip_i2s.c
index 74e7d6ee0f28..b0c3ef030e06 100644
--- a/sound/soc/rockchip/rockchip_i2s.c
+++ b/sound/soc/rockchip/rockchip_i2s.c
@@ -10,8 +10,8 @@
 #include 
 #include 
 #include 
+#include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -736,7 +736,6 @@ static int rockchip_i2s_init_dai(struct rk_i2s_dev *i2s, 
struct resource *res,
 static int rockchip_i2s_probe(struct platform_device *pdev)
 {
struct device_node *node = pdev->dev.of_node;
-   const struct of_device_id *of_id;
struct rk_i2s_dev *i2s;
struct snd_soc_dai_driver *dai;
struct resource *res;
@@ -752,11 +751,10 @@ static int rockchip_i2s_probe(struct platform_device 
*pdev)
 
i2s->grf = syscon_regmap_lookup_by_phandle(node, "rockchip,grf");
if (!IS_ERR(i2s->grf)) {
-   of_

[PATCH v2 4/5] ASoC: qcom/lpass: Constify struct lpass_variant

2023-10-04 Thread Rob Herring
'struct lpass_variant' is used for driver match data which is supposed to
be constant. It's not modified anywhere, so it's just a matter of adding
'const' everywhere.

Signed-off-by: Rob Herring 
---
 sound/soc/qcom/lpass-apq8016.c  |  6 +++---
 sound/soc/qcom/lpass-cdc-dma.c  |  2 +-
 sound/soc/qcom/lpass-cpu.c  | 28 ++--
 sound/soc/qcom/lpass-ipq806x.c  |  2 +-
 sound/soc/qcom/lpass-platform.c | 36 ++--
 sound/soc/qcom/lpass-sc7180.c   |  6 +++---
 sound/soc/qcom/lpass-sc7280.c   |  6 +++---
 sound/soc/qcom/lpass.h  |  2 +-
 8 files changed, 44 insertions(+), 44 deletions(-)

diff --git a/sound/soc/qcom/lpass-apq8016.c b/sound/soc/qcom/lpass-apq8016.c
index f919d46e18ca..8ce75b442b64 100644
--- a/sound/soc/qcom/lpass-apq8016.c
+++ b/sound/soc/qcom/lpass-apq8016.c
@@ -123,7 +123,7 @@ static struct snd_soc_dai_driver 
apq8016_lpass_cpu_dai_driver[] = {
 static int apq8016_lpass_alloc_dma_channel(struct lpass_data *drvdata,
   int direction, unsigned int dai_id)
 {
-   struct lpass_variant *v = drvdata->variant;
+   const struct lpass_variant *v = drvdata->variant;
int chan = 0;
 
if (direction == SNDRV_PCM_STREAM_PLAYBACK) {
@@ -157,7 +157,7 @@ static int apq8016_lpass_free_dma_channel(struct lpass_data 
*drvdata, int chan,
 static int apq8016_lpass_init(struct platform_device *pdev)
 {
struct lpass_data *drvdata = platform_get_drvdata(pdev);
-   struct lpass_variant *variant = drvdata->variant;
+   const struct lpass_variant *variant = drvdata->variant;
struct device *dev = >dev;
int ret, i;
 
@@ -223,7 +223,7 @@ static int apq8016_lpass_exit(struct platform_device *pdev)
 }
 
 
-static struct lpass_variant apq8016_data = {
+static const struct lpass_variant apq8016_data = {
.i2sctrl_reg_base   = 0x1000,
.i2sctrl_reg_stride = 0x1000,
.i2s_ports  = 4,
diff --git a/sound/soc/qcom/lpass-cdc-dma.c b/sound/soc/qcom/lpass-cdc-dma.c
index 8221e2cbe35c..6389c7b6051e 100644
--- a/sound/soc/qcom/lpass-cdc-dma.c
+++ b/sound/soc/qcom/lpass-cdc-dma.c
@@ -37,7 +37,7 @@ static void __lpass_get_dmactl_handle(struct 
snd_pcm_substream *substream, struc
struct lpass_data *drvdata = snd_soc_dai_get_drvdata(dai);
struct snd_pcm_runtime *rt = substream->runtime;
struct lpass_pcm_data *pcm_data = rt->private_data;
-   struct lpass_variant *v = drvdata->variant;
+   const struct lpass_variant *v = drvdata->variant;
unsigned int dai_id = cpu_dai->driver->id;
 
switch (dai_id) {
diff --git a/sound/soc/qcom/lpass-cpu.c b/sound/soc/qcom/lpass-cpu.c
index 39571fed4001..18aff2654f89 100644
--- a/sound/soc/qcom/lpass-cpu.c
+++ b/sound/soc/qcom/lpass-cpu.c
@@ -44,7 +44,7 @@ static int lpass_cpu_init_i2sctl_bitfields(struct device *dev,
struct lpaif_i2sctl *i2sctl, struct regmap *map)
 {
struct lpass_data *drvdata = dev_get_drvdata(dev);
-   struct lpass_variant *v = drvdata->variant;
+   const struct lpass_variant *v = drvdata->variant;
 
i2sctl->loopback = devm_regmap_field_alloc(dev, map, v->loopback);
i2sctl->spken = devm_regmap_field_alloc(dev, map, v->spken);
@@ -463,7 +463,7 @@ static int asoc_qcom_of_xlate_dai_name(struct 
snd_soc_component *component,
   const char **dai_name)
 {
struct lpass_data *drvdata = snd_soc_component_get_drvdata(component);
-   struct lpass_variant *variant = drvdata->variant;
+   const struct lpass_variant *variant = drvdata->variant;
int id = args->args[0];
int ret = -EINVAL;
int i;
@@ -488,7 +488,7 @@ static const struct snd_soc_component_driver 
lpass_cpu_comp_driver = {
 static bool lpass_cpu_regmap_writeable(struct device *dev, unsigned int reg)
 {
struct lpass_data *drvdata = dev_get_drvdata(dev);
-   struct lpass_variant *v = drvdata->variant;
+   const struct lpass_variant *v = drvdata->variant;
int i;
 
for (i = 0; i < v->i2s_ports; ++i)
@@ -530,7 +530,7 @@ static bool lpass_cpu_regmap_writeable(struct device *dev, 
unsigned int reg)
 static bool lpass_cpu_regmap_readable(struct device *dev, unsigned int reg)
 {
struct lpass_data *drvdata = dev_get_drvdata(dev);
-   struct lpass_variant *v = drvdata->variant;
+   const struct lpass_variant *v = drvdata->variant;
int i;
 
for (i = 0; i < v->i2s_ports; ++i)
@@ -578,7 +578,7 @@ static bool lpass_cpu_regmap_readable(struct device *dev, 
unsigned int reg)
 static bool lpass_cpu_regmap_volatile(struct device *dev, unsigned int reg)
 {
struct lpass_data *drvdata = dev_get_drvdata(dev);
-   struct lpass_variant *v = drvdata->variant;
+   const struct lpass_variant *v = drvdata->variant;
int i;
 
  

[PATCH v2 2/5] ASoC: Drop unnecessary of_match_device() calls

2023-10-04 Thread Rob Herring
If probe is reached, we've already matched the device and in the case of
DT matching, the struct device_node pointer will be set. Therefore, there
is no need to call of_match_device() in probe.

Acked-by: Charles Keepax 
Signed-off-by: Rob Herring 
---
 sound/soc/codecs/ak5386.c  |  7 ++-
 sound/soc/codecs/cs4271.c  | 22 ++
 sound/soc/codecs/tas5086.c |  6 +-
 3 files changed, 9 insertions(+), 26 deletions(-)

diff --git a/sound/soc/codecs/ak5386.c b/sound/soc/codecs/ak5386.c
index 0c5e00679c7d..21a44476f48d 100644
--- a/sound/soc/codecs/ak5386.c
+++ b/sound/soc/codecs/ak5386.c
@@ -10,7 +10,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -168,7 +167,6 @@ static int ak5386_probe(struct platform_device *pdev)
if (!priv)
return -ENOMEM;
 
-   priv->reset_gpio = -EINVAL;
dev_set_drvdata(dev, priv);
 
for (i = 0; i < ARRAY_SIZE(supply_names); i++)
@@ -179,9 +177,8 @@ static int ak5386_probe(struct platform_device *pdev)
if (ret < 0)
return ret;
 
-   if (of_match_device(of_match_ptr(ak5386_dt_ids), dev))
-   priv->reset_gpio = of_get_named_gpio(dev->of_node,
- "reset-gpio", 0);
+   priv->reset_gpio = of_get_named_gpio(dev->of_node,
+"reset-gpio", 0);
 
if (gpio_is_valid(priv->reset_gpio))
if (devm_gpio_request_one(dev, priv->reset_gpio,
diff --git a/sound/soc/codecs/cs4271.c b/sound/soc/codecs/cs4271.c
index 188b8b43c524..9e6f8a048dd5 100644
--- a/sound/soc/codecs/cs4271.c
+++ b/sound/soc/codecs/cs4271.c
@@ -15,7 +15,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -563,19 +562,12 @@ static int cs4271_component_probe(struct 
snd_soc_component *component)
struct cs4271_private *cs4271 = 
snd_soc_component_get_drvdata(component);
struct cs4271_platform_data *cs4271plat = component->dev->platform_data;
int ret;
-   bool amutec_eq_bmutec = false;
+   bool amutec_eq_bmutec;
 
-#ifdef CONFIG_OF
-   if (of_match_device(cs4271_dt_ids, component->dev)) {
-   if (of_get_property(component->dev->of_node,
-"cirrus,amutec-eq-bmutec", NULL))
-   amutec_eq_bmutec = true;
-
-   if (of_get_property(component->dev->of_node,
-"cirrus,enable-soft-reset", NULL))
-   cs4271->enable_soft_reset = true;
-   }
-#endif
+   amutec_eq_bmutec = of_property_read_bool(component->dev->of_node,
+"cirrus,amutec-eq-bmutec");
+   cs4271->enable_soft_reset = 
of_property_read_bool(component->dev->of_node,
+ 
"cirrus,enable-soft-reset");
 
ret = regulator_bulk_enable(ARRAY_SIZE(cs4271->supplies),
cs4271->supplies);
@@ -655,9 +647,7 @@ static int cs4271_common_probe(struct device *dev,
if (!cs4271)
return -ENOMEM;
 
-   if (of_match_device(cs4271_dt_ids, dev))
-   cs4271->gpio_nreset =
-   of_get_named_gpio(dev->of_node, "reset-gpio", 0);
+   cs4271->gpio_nreset = of_get_named_gpio(dev->of_node, "reset-gpio", 0);
 
if (cs4271plat)
cs4271->gpio_nreset = cs4271plat->gpio_nreset;
diff --git a/sound/soc/codecs/tas5086.c b/sound/soc/codecs/tas5086.c
index 60e59e993ba6..f52c14b43f28 100644
--- a/sound/soc/codecs/tas5086.c
+++ b/sound/soc/codecs/tas5086.c
@@ -940,11 +940,7 @@ static int tas5086_i2c_probe(struct i2c_client *i2c)
 
i2c_set_clientdata(i2c, priv);
 
-   if (of_match_device(of_match_ptr(tas5086_dt_ids), dev)) {
-   struct device_node *of_node = dev->of_node;
-   gpio_nreset = of_get_named_gpio(of_node, "reset-gpio", 0);
-   }
-
+   gpio_nreset = of_get_named_gpio(dev->of_node, "reset-gpio", 0);
if (gpio_is_valid(gpio_nreset))
if (devm_gpio_request(dev, gpio_nreset, "TAS5086 Reset"))
gpio_nreset = -EINVAL;

-- 
2.40.1



[PATCH v2 0/5] ASoC: DT matching and header cleanups

2023-10-04 Thread Rob Herring
(trimmed the recipient list due to bounces on v1)

This is a series is part of ongoing clean-ups related to device 
matching and DT related implicit includes. Essentially of_device.h has 
a bunch of implicit includes and generally isn't needed any nore except 
for of_match_device(). As we also generally want to get rid of 
of_match_device() as well, I've done that so we're not updating the 
includes twice.

Signed-off-by: Rob Herring 
---
Changes in v2:
- Add tags
- Link to v1: 
https://lore.kernel.org/r/20231003-dt-asoc-header-cleanups-v1-0-308666806...@kernel.org
- Link to v1 resend: 
https://lore.kernel.org/r/20231003-dt-asoc-header-cleanups-v1-0-05b5d6447...@kernel.org/

---
Rob Herring (5):
  ASoC: Explicitly include correct DT includes
  ASoC: Drop unnecessary of_match_device() calls
  ASoC: da7218: Use i2c_get_match_data()
  ASoC: qcom/lpass: Constify struct lpass_variant
  ASoC: Use device_get_match_data()

 sound/soc/atmel/atmel_wm8904.c |  1 -
 sound/soc/atmel/mchp-i2s-mcc.c |  2 +-
 sound/soc/atmel/tse850-pcm5142.c   |  1 -
 sound/soc/bcm/cygnus-ssp.c |  2 +-
 sound/soc/codecs/adau1701.c|  1 -
 sound/soc/codecs/adau1977-spi.c|  1 -
 sound/soc/codecs/ak4104.c  |  2 +-
 sound/soc/codecs/ak4118.c  |  2 +-
 sound/soc/codecs/ak4375.c  |  2 +-
 sound/soc/codecs/ak4458.c  |  2 +-
 sound/soc/codecs/ak4613.c  |  2 +-
 sound/soc/codecs/ak4642.c  |  2 +-
 sound/soc/codecs/ak5386.c  |  7 +---
 sound/soc/codecs/ak5558.c  |  2 +-
 sound/soc/codecs/cs35l32.c |  2 +-
 sound/soc/codecs/cs35l33.c |  2 -
 sound/soc/codecs/cs35l34.c |  2 +-
 sound/soc/codecs/cs35l35.c |  3 +-
 sound/soc/codecs/cs35l36.c |  3 +-
 sound/soc/codecs/cs35l41-i2c.c |  2 +-
 sound/soc/codecs/cs35l41.c |  1 -
 sound/soc/codecs/cs4270.c  |  2 +-
 sound/soc/codecs/cs4271.c  | 22 +++
 sound/soc/codecs/cs42l42.c |  1 -
 sound/soc/codecs/cs42l56.c |  2 +-
 sound/soc/codecs/cs42xx8-i2c.c |  2 +-
 sound/soc/codecs/cs43130.c |  3 +-
 sound/soc/codecs/cs4349.c  |  2 +-
 sound/soc/codecs/da7213.c  |  2 +-
 sound/soc/codecs/da7218.c  | 29 +--
 sound/soc/codecs/da7218.h  |  2 +-
 sound/soc/codecs/da7219.c  |  2 +-
 sound/soc/codecs/da9055.c  |  1 -
 sound/soc/codecs/es8328.c  |  1 -
 sound/soc/codecs/gtm601.c  |  2 +-
 sound/soc/codecs/lpass-macro-common.c  |  2 +-
 sound/soc/codecs/mt6351.c  |  2 +-
 sound/soc/codecs/mt6358.c  |  2 +-
 sound/soc/codecs/mt6359-accdet.c   |  4 --
 sound/soc/codecs/mt6359.c  |  2 +-
 sound/soc/codecs/nau8540.c |  2 +-
 sound/soc/codecs/pcm1681.c |  2 -
 sound/soc/codecs/rt715.c   |  2 -
 sound/soc/codecs/sgtl5000.c|  2 +-
 sound/soc/codecs/sma1303.c |  2 +-
 sound/soc/codecs/sta32x.c  |  3 +-
 sound/soc/codecs/sta350.c  |  3 +-
 sound/soc/codecs/tas5086.c |  6 +--
 sound/soc/codecs/tas571x.c |  2 +-
 sound/soc/codecs/uda1334.c |  2 +-
 sound/soc/codecs/wm8510.c  |  2 +-
 sound/soc/codecs/wm8523.c  |  2 +-
 sound/soc/codecs/wm8524.c  |  2 +-
 sound/soc/codecs/wm8580.c  |  2 +-
 sound/soc/codecs/wm8711.c  |  2 +-
 sound/soc/codecs/wm8728.c  |  2 +-
 sound/soc/codecs/wm8731-i2c.c  |  2 +-
 sound/soc/codecs/wm8731-spi.c  |  2 +-
 sound/soc/codecs/wm8737.c  |  2 +-
 sound/soc/codecs/wm8741.c  |  2 +-
 sound/soc/codecs/wm8750.c  |  2 +-
 sound/soc/codecs/wm8753.c  |  2 +-
 sound/soc/codecs/wm8770.c  |  2 +-
 sound/soc/codecs/wm8776.c  |  2 +-
 sound/soc/codecs/wm8804.c  |  1 -
 sound/soc/fsl/efika-audio-fabric.c |  4 +-
 sound/soc/fsl/fsl_aud2htx.c|  3 +-
 sound/soc/fsl

[PATCH RESEND 3/5] ASoC: da7218: Use i2c_get_match_data()

2023-10-03 Thread Rob Herring
Use preferred i2c_get_match_data() instead of of_match_device() and
i2c_match_id() to get the driver match data. With this, adjust the
includes to explicitly include the correct headers.

Avoid using 0 for enum da7218_dev_id so that no match data can be
distinguished.

Signed-off-by: Rob Herring 
---
 sound/soc/codecs/da7218.c | 29 ++---
 sound/soc/codecs/da7218.h |  2 +-
 2 files changed, 3 insertions(+), 28 deletions(-)

diff --git a/sound/soc/codecs/da7218.c b/sound/soc/codecs/da7218.c
index 3f456b08b809..8aacd7350798 100644
--- a/sound/soc/codecs/da7218.c
+++ b/sound/soc/codecs/da7218.c
@@ -9,7 +9,7 @@
 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -2285,16 +2285,6 @@ static const struct of_device_id da7218_of_match[] = {
 };
 MODULE_DEVICE_TABLE(of, da7218_of_match);
 
-static inline int da7218_of_get_id(struct device *dev)
-{
-   const struct of_device_id *id = of_match_device(da7218_of_match, dev);
-
-   if (id)
-   return (uintptr_t)id->data;
-   else
-   return -EINVAL;
-}
-
 static enum da7218_micbias_voltage
da7218_of_micbias_lvl(struct snd_soc_component *component, u32 val)
 {
@@ -3253,18 +3243,6 @@ static const struct regmap_config da7218_regmap_config = 
{
  * I2C layer
  */
 
-static const struct i2c_device_id da7218_i2c_id[];
-
-static inline int da7218_i2c_get_id(struct i2c_client *i2c)
-{
-   const struct i2c_device_id *id = i2c_match_id(da7218_i2c_id, i2c);
-
-   if (id)
-   return (uintptr_t)id->driver_data;
-   else
-   return -EINVAL;
-}
-
 static int da7218_i2c_probe(struct i2c_client *i2c)
 {
struct da7218_priv *da7218;
@@ -3276,10 +3254,7 @@ static int da7218_i2c_probe(struct i2c_client *i2c)
 
i2c_set_clientdata(i2c, da7218);
 
-   if (i2c->dev.of_node)
-   da7218->dev_id = da7218_of_get_id(>dev);
-   else
-   da7218->dev_id = da7218_i2c_get_id(i2c);
+   da7218->dev_id = (uintptr_t)i2c_get_match_data(i2c);
 
if ((da7218->dev_id != DA7217_DEV_ID) &&
(da7218->dev_id != DA7218_DEV_ID)) {
diff --git a/sound/soc/codecs/da7218.h b/sound/soc/codecs/da7218.h
index 9ac2892092b5..7f6a4aea2c7a 100644
--- a/sound/soc/codecs/da7218.h
+++ b/sound/soc/codecs/da7218.h
@@ -1369,7 +1369,7 @@ enum da7218_sys_clk {
 };
 
 enum da7218_dev_id {
-   DA7217_DEV_ID = 0,
+   DA7217_DEV_ID = 1,
DA7218_DEV_ID,
 };
 

-- 
2.40.1



[PATCH RESEND 5/5] ASoC: Use device_get_match_data()

2023-10-03 Thread Rob Herring
Use preferred device_get_match_data() instead of of_match_device() to
get the driver match data. With this, adjust the includes to explicitly
include the correct headers.

Signed-off-by: Rob Herring 
---
 sound/soc/intel/keembay/kmb_platform.c | 13 +
 sound/soc/qcom/lpass-cpu.c | 15 +--
 sound/soc/rockchip/rockchip_i2s.c  |  8 +++-
 sound/soc/rockchip/rockchip_i2s_tdm.c  | 20 +++-
 sound/soc/rockchip/rockchip_pdm.c  |  6 +-
 sound/soc/samsung/smdk_wm8994.c| 27 +++
 sound/soc/stm/stm32_i2s.c  |  7 ++-
 sound/soc/stm/stm32_sai.c  |  8 
 sound/soc/stm/stm32_sai_sub.c  |  6 +-
 sound/soc/stm/stm32_spdifrx.c  |  8 ++--
 sound/soc/tegra/tegra210_amx.c |  7 +--
 sound/soc/ti/davinci-evm.c |  7 ++-
 sound/soc/ti/davinci-mcasp.c   |  9 -
 sound/soc/ti/omap-mcbsp.c  | 10 --
 14 files changed, 40 insertions(+), 111 deletions(-)

diff --git a/sound/soc/intel/keembay/kmb_platform.c 
b/sound/soc/intel/keembay/kmb_platform.c
index e929497a5eb5..37ea2e1d2e92 100644
--- a/sound/soc/intel/keembay/kmb_platform.c
+++ b/sound/soc/intel/keembay/kmb_platform.c
@@ -11,7 +11,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -820,7 +819,6 @@ static int kmb_plat_dai_probe(struct platform_device *pdev)
 {
struct device_node *np = pdev->dev.of_node;
struct snd_soc_dai_driver *kmb_i2s_dai;
-   const struct of_device_id *match;
struct device *dev = >dev;
struct kmb_i2s_info *kmb_i2s;
struct resource *res;
@@ -831,16 +829,7 @@ static int kmb_plat_dai_probe(struct platform_device *pdev)
if (!kmb_i2s)
return -ENOMEM;
 
-   kmb_i2s_dai = devm_kzalloc(dev, sizeof(*kmb_i2s_dai), GFP_KERNEL);
-   if (!kmb_i2s_dai)
-   return -ENOMEM;
-
-   match = of_match_device(kmb_plat_of_match, >dev);
-   if (!match) {
-   dev_err(>dev, "Error: No device match found\n");
-   return -ENODEV;
-   }
-   kmb_i2s_dai = (struct snd_soc_dai_driver *) match->data;
+   kmb_i2s_dai = (struct snd_soc_dai_driver 
*)device_get_match_data(>dev);
 
/* Prepare the related clocks */
kmb_i2s->clk_apb = devm_clk_get(dev, "apb_clk");
diff --git a/sound/soc/qcom/lpass-cpu.c b/sound/soc/qcom/lpass-cpu.c
index 18aff2654f89..ac0feb89b458 100644
--- a/sound/soc/qcom/lpass-cpu.c
+++ b/sound/soc/qcom/lpass-cpu.c
@@ -9,7 +9,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -1106,7 +1105,6 @@ int asoc_qcom_lpass_cpu_platform_probe(struct 
platform_device *pdev)
struct resource *res;
const struct lpass_variant *variant;
struct device *dev = >dev;
-   const struct of_device_id *match;
int ret, i, dai_id;
 
dsp_of_node = of_parse_phandle(pdev->dev.of_node, "qcom,adsp", 0);
@@ -1121,17 +1119,14 @@ int asoc_qcom_lpass_cpu_platform_probe(struct 
platform_device *pdev)
return -ENOMEM;
platform_set_drvdata(pdev, drvdata);
 
-   match = of_match_device(dev->driver->of_match_table, dev);
-   if (!match || !match->data)
+   variant = device_get_match_data(dev);
+   if (!variant)
return -EINVAL;
 
-   if (of_device_is_compatible(dev->of_node, "qcom,lpass-cpu-apq8016")) {
-   dev_warn(dev, "%s compatible is deprecated\n",
-match->compatible);
-   }
+   if (of_device_is_compatible(dev->of_node, "qcom,lpass-cpu-apq8016"))
+   dev_warn(dev, "qcom,lpass-cpu-apq8016 compatible is 
deprecated\n");
 
-   drvdata->variant = (struct lpass_variant *)match->data;
-   variant = drvdata->variant;
+   drvdata->variant = variant;
 
of_lpass_cpu_parse_dai_data(dev, drvdata);
 
diff --git a/sound/soc/rockchip/rockchip_i2s.c 
b/sound/soc/rockchip/rockchip_i2s.c
index 74e7d6ee0f28..b0c3ef030e06 100644
--- a/sound/soc/rockchip/rockchip_i2s.c
+++ b/sound/soc/rockchip/rockchip_i2s.c
@@ -10,8 +10,8 @@
 #include 
 #include 
 #include 
+#include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -736,7 +736,6 @@ static int rockchip_i2s_init_dai(struct rk_i2s_dev *i2s, 
struct resource *res,
 static int rockchip_i2s_probe(struct platform_device *pdev)
 {
struct device_node *node = pdev->dev.of_node;
-   const struct of_device_id *of_id;
struct rk_i2s_dev *i2s;
struct snd_soc_dai_driver *dai;
struct resource *res;
@@ -752,11 +751,10 @@ static int rockchip_i2s_probe(struct platform_device 
*pdev)
 
i2s->grf = syscon_regmap_lookup_by_phandle(node, "rockchip,grf");
if (!IS_ERR(i2s->grf)) {
-   of_

[PATCH RESEND 2/5] ASoC: Drop unnecessary of_match_device() calls

2023-10-03 Thread Rob Herring
If probe is reached, we've already matched the device and in the case of
DT matching, the struct device_node pointer will be set. Therefore, there
is no need to call of_match_device() in probe.

Signed-off-by: Rob Herring 
---
 sound/soc/codecs/ak5386.c  |  7 ++-
 sound/soc/codecs/cs4271.c  | 22 ++
 sound/soc/codecs/tas5086.c |  6 +-
 3 files changed, 9 insertions(+), 26 deletions(-)

diff --git a/sound/soc/codecs/ak5386.c b/sound/soc/codecs/ak5386.c
index 0c5e00679c7d..21a44476f48d 100644
--- a/sound/soc/codecs/ak5386.c
+++ b/sound/soc/codecs/ak5386.c
@@ -10,7 +10,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -168,7 +167,6 @@ static int ak5386_probe(struct platform_device *pdev)
if (!priv)
return -ENOMEM;
 
-   priv->reset_gpio = -EINVAL;
dev_set_drvdata(dev, priv);
 
for (i = 0; i < ARRAY_SIZE(supply_names); i++)
@@ -179,9 +177,8 @@ static int ak5386_probe(struct platform_device *pdev)
if (ret < 0)
return ret;
 
-   if (of_match_device(of_match_ptr(ak5386_dt_ids), dev))
-   priv->reset_gpio = of_get_named_gpio(dev->of_node,
- "reset-gpio", 0);
+   priv->reset_gpio = of_get_named_gpio(dev->of_node,
+"reset-gpio", 0);
 
if (gpio_is_valid(priv->reset_gpio))
if (devm_gpio_request_one(dev, priv->reset_gpio,
diff --git a/sound/soc/codecs/cs4271.c b/sound/soc/codecs/cs4271.c
index 188b8b43c524..9e6f8a048dd5 100644
--- a/sound/soc/codecs/cs4271.c
+++ b/sound/soc/codecs/cs4271.c
@@ -15,7 +15,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -563,19 +562,12 @@ static int cs4271_component_probe(struct 
snd_soc_component *component)
struct cs4271_private *cs4271 = 
snd_soc_component_get_drvdata(component);
struct cs4271_platform_data *cs4271plat = component->dev->platform_data;
int ret;
-   bool amutec_eq_bmutec = false;
+   bool amutec_eq_bmutec;
 
-#ifdef CONFIG_OF
-   if (of_match_device(cs4271_dt_ids, component->dev)) {
-   if (of_get_property(component->dev->of_node,
-"cirrus,amutec-eq-bmutec", NULL))
-   amutec_eq_bmutec = true;
-
-   if (of_get_property(component->dev->of_node,
-"cirrus,enable-soft-reset", NULL))
-   cs4271->enable_soft_reset = true;
-   }
-#endif
+   amutec_eq_bmutec = of_property_read_bool(component->dev->of_node,
+"cirrus,amutec-eq-bmutec");
+   cs4271->enable_soft_reset = 
of_property_read_bool(component->dev->of_node,
+ 
"cirrus,enable-soft-reset");
 
ret = regulator_bulk_enable(ARRAY_SIZE(cs4271->supplies),
cs4271->supplies);
@@ -655,9 +647,7 @@ static int cs4271_common_probe(struct device *dev,
if (!cs4271)
return -ENOMEM;
 
-   if (of_match_device(cs4271_dt_ids, dev))
-   cs4271->gpio_nreset =
-   of_get_named_gpio(dev->of_node, "reset-gpio", 0);
+   cs4271->gpio_nreset = of_get_named_gpio(dev->of_node, "reset-gpio", 0);
 
if (cs4271plat)
cs4271->gpio_nreset = cs4271plat->gpio_nreset;
diff --git a/sound/soc/codecs/tas5086.c b/sound/soc/codecs/tas5086.c
index 60e59e993ba6..f52c14b43f28 100644
--- a/sound/soc/codecs/tas5086.c
+++ b/sound/soc/codecs/tas5086.c
@@ -940,11 +940,7 @@ static int tas5086_i2c_probe(struct i2c_client *i2c)
 
i2c_set_clientdata(i2c, priv);
 
-   if (of_match_device(of_match_ptr(tas5086_dt_ids), dev)) {
-   struct device_node *of_node = dev->of_node;
-   gpio_nreset = of_get_named_gpio(of_node, "reset-gpio", 0);
-   }
-
+   gpio_nreset = of_get_named_gpio(dev->of_node, "reset-gpio", 0);
if (gpio_is_valid(gpio_nreset))
if (devm_gpio_request(dev, gpio_nreset, "TAS5086 Reset"))
gpio_nreset = -EINVAL;

-- 
2.40.1



[PATCH RESEND 4/5] ASoC: qcom/lpass: Constify struct lpass_variant

2023-10-03 Thread Rob Herring
'struct lpass_variant' is used for driver match data which is supposed to
be constant. It's not modified anywhere, so it's just a matter of adding
'const' everywhere.

Signed-off-by: Rob Herring 
---
 sound/soc/qcom/lpass-apq8016.c  |  6 +++---
 sound/soc/qcom/lpass-cdc-dma.c  |  2 +-
 sound/soc/qcom/lpass-cpu.c  | 28 ++--
 sound/soc/qcom/lpass-ipq806x.c  |  2 +-
 sound/soc/qcom/lpass-platform.c | 36 ++--
 sound/soc/qcom/lpass-sc7180.c   |  6 +++---
 sound/soc/qcom/lpass-sc7280.c   |  6 +++---
 sound/soc/qcom/lpass.h  |  2 +-
 8 files changed, 44 insertions(+), 44 deletions(-)

diff --git a/sound/soc/qcom/lpass-apq8016.c b/sound/soc/qcom/lpass-apq8016.c
index f919d46e18ca..8ce75b442b64 100644
--- a/sound/soc/qcom/lpass-apq8016.c
+++ b/sound/soc/qcom/lpass-apq8016.c
@@ -123,7 +123,7 @@ static struct snd_soc_dai_driver 
apq8016_lpass_cpu_dai_driver[] = {
 static int apq8016_lpass_alloc_dma_channel(struct lpass_data *drvdata,
   int direction, unsigned int dai_id)
 {
-   struct lpass_variant *v = drvdata->variant;
+   const struct lpass_variant *v = drvdata->variant;
int chan = 0;
 
if (direction == SNDRV_PCM_STREAM_PLAYBACK) {
@@ -157,7 +157,7 @@ static int apq8016_lpass_free_dma_channel(struct lpass_data 
*drvdata, int chan,
 static int apq8016_lpass_init(struct platform_device *pdev)
 {
struct lpass_data *drvdata = platform_get_drvdata(pdev);
-   struct lpass_variant *variant = drvdata->variant;
+   const struct lpass_variant *variant = drvdata->variant;
struct device *dev = >dev;
int ret, i;
 
@@ -223,7 +223,7 @@ static int apq8016_lpass_exit(struct platform_device *pdev)
 }
 
 
-static struct lpass_variant apq8016_data = {
+static const struct lpass_variant apq8016_data = {
.i2sctrl_reg_base   = 0x1000,
.i2sctrl_reg_stride = 0x1000,
.i2s_ports  = 4,
diff --git a/sound/soc/qcom/lpass-cdc-dma.c b/sound/soc/qcom/lpass-cdc-dma.c
index 8221e2cbe35c..6389c7b6051e 100644
--- a/sound/soc/qcom/lpass-cdc-dma.c
+++ b/sound/soc/qcom/lpass-cdc-dma.c
@@ -37,7 +37,7 @@ static void __lpass_get_dmactl_handle(struct 
snd_pcm_substream *substream, struc
struct lpass_data *drvdata = snd_soc_dai_get_drvdata(dai);
struct snd_pcm_runtime *rt = substream->runtime;
struct lpass_pcm_data *pcm_data = rt->private_data;
-   struct lpass_variant *v = drvdata->variant;
+   const struct lpass_variant *v = drvdata->variant;
unsigned int dai_id = cpu_dai->driver->id;
 
switch (dai_id) {
diff --git a/sound/soc/qcom/lpass-cpu.c b/sound/soc/qcom/lpass-cpu.c
index 39571fed4001..18aff2654f89 100644
--- a/sound/soc/qcom/lpass-cpu.c
+++ b/sound/soc/qcom/lpass-cpu.c
@@ -44,7 +44,7 @@ static int lpass_cpu_init_i2sctl_bitfields(struct device *dev,
struct lpaif_i2sctl *i2sctl, struct regmap *map)
 {
struct lpass_data *drvdata = dev_get_drvdata(dev);
-   struct lpass_variant *v = drvdata->variant;
+   const struct lpass_variant *v = drvdata->variant;
 
i2sctl->loopback = devm_regmap_field_alloc(dev, map, v->loopback);
i2sctl->spken = devm_regmap_field_alloc(dev, map, v->spken);
@@ -463,7 +463,7 @@ static int asoc_qcom_of_xlate_dai_name(struct 
snd_soc_component *component,
   const char **dai_name)
 {
struct lpass_data *drvdata = snd_soc_component_get_drvdata(component);
-   struct lpass_variant *variant = drvdata->variant;
+   const struct lpass_variant *variant = drvdata->variant;
int id = args->args[0];
int ret = -EINVAL;
int i;
@@ -488,7 +488,7 @@ static const struct snd_soc_component_driver 
lpass_cpu_comp_driver = {
 static bool lpass_cpu_regmap_writeable(struct device *dev, unsigned int reg)
 {
struct lpass_data *drvdata = dev_get_drvdata(dev);
-   struct lpass_variant *v = drvdata->variant;
+   const struct lpass_variant *v = drvdata->variant;
int i;
 
for (i = 0; i < v->i2s_ports; ++i)
@@ -530,7 +530,7 @@ static bool lpass_cpu_regmap_writeable(struct device *dev, 
unsigned int reg)
 static bool lpass_cpu_regmap_readable(struct device *dev, unsigned int reg)
 {
struct lpass_data *drvdata = dev_get_drvdata(dev);
-   struct lpass_variant *v = drvdata->variant;
+   const struct lpass_variant *v = drvdata->variant;
int i;
 
for (i = 0; i < v->i2s_ports; ++i)
@@ -578,7 +578,7 @@ static bool lpass_cpu_regmap_readable(struct device *dev, 
unsigned int reg)
 static bool lpass_cpu_regmap_volatile(struct device *dev, unsigned int reg)
 {
struct lpass_data *drvdata = dev_get_drvdata(dev);
-   struct lpass_variant *v = drvdata->variant;
+   const struct lpass_variant *v = drvdata->variant;
int i;
 
  

[PATCH RESEND 1/5] ASoC: Explicitly include correct DT includes

2023-10-03 Thread Rob Herring
The DT of_device.h and of_platform.h date back to the separate
of_platform_bus_type before it was merged into the regular platform bus.
As part of that merge prepping Arm DT support 13 years ago, they
"temporarily" include each other. They also include platform_device.h
and of.h. As a result, there's a pretty much random mix of those include
files used throughout the tree. In order to detangle these headers and
replace the implicit includes with struct declarations, users need to
explicitly include the correct includes.

Signed-off-by: Rob Herring 
---
 sound/soc/atmel/atmel_wm8904.c | 1 -
 sound/soc/atmel/mchp-i2s-mcc.c | 2 +-
 sound/soc/atmel/tse850-pcm5142.c   | 1 -
 sound/soc/bcm/cygnus-ssp.c | 2 +-
 sound/soc/codecs/adau1701.c| 1 -
 sound/soc/codecs/adau1977-spi.c| 1 -
 sound/soc/codecs/ak4104.c  | 2 +-
 sound/soc/codecs/ak4118.c  | 2 +-
 sound/soc/codecs/ak4375.c  | 2 +-
 sound/soc/codecs/ak4458.c  | 2 +-
 sound/soc/codecs/ak4613.c  | 2 +-
 sound/soc/codecs/ak4642.c  | 2 +-
 sound/soc/codecs/ak5558.c  | 2 +-
 sound/soc/codecs/cs35l32.c | 2 +-
 sound/soc/codecs/cs35l33.c | 2 --
 sound/soc/codecs/cs35l34.c | 2 +-
 sound/soc/codecs/cs35l35.c | 3 +--
 sound/soc/codecs/cs35l36.c | 3 +--
 sound/soc/codecs/cs35l41-i2c.c | 2 +-
 sound/soc/codecs/cs35l41.c | 1 -
 sound/soc/codecs/cs4270.c  | 2 +-
 sound/soc/codecs/cs42l42.c | 1 -
 sound/soc/codecs/cs42l56.c | 2 +-
 sound/soc/codecs/cs42xx8-i2c.c | 2 +-
 sound/soc/codecs/cs43130.c | 3 +--
 sound/soc/codecs/cs4349.c  | 2 +-
 sound/soc/codecs/da7213.c  | 2 +-
 sound/soc/codecs/da7219.c  | 2 +-
 sound/soc/codecs/da9055.c  | 1 -
 sound/soc/codecs/es8328.c  | 1 -
 sound/soc/codecs/gtm601.c  | 2 +-
 sound/soc/codecs/lpass-macro-common.c  | 2 +-
 sound/soc/codecs/mt6351.c  | 2 +-
 sound/soc/codecs/mt6358.c  | 2 +-
 sound/soc/codecs/mt6359-accdet.c   | 4 
 sound/soc/codecs/mt6359.c  | 2 +-
 sound/soc/codecs/nau8540.c | 2 +-
 sound/soc/codecs/pcm1681.c | 2 --
 sound/soc/codecs/rt715.c   | 2 --
 sound/soc/codecs/sgtl5000.c| 2 +-
 sound/soc/codecs/sma1303.c | 2 +-
 sound/soc/codecs/sta32x.c  | 3 +--
 sound/soc/codecs/sta350.c  | 3 +--
 sound/soc/codecs/tas571x.c | 2 +-
 sound/soc/codecs/uda1334.c | 2 +-
 sound/soc/codecs/wm8510.c  | 2 +-
 sound/soc/codecs/wm8523.c  | 2 +-
 sound/soc/codecs/wm8524.c  | 2 +-
 sound/soc/codecs/wm8580.c  | 2 +-
 sound/soc/codecs/wm8711.c  | 2 +-
 sound/soc/codecs/wm8728.c  | 2 +-
 sound/soc/codecs/wm8731-i2c.c  | 2 +-
 sound/soc/codecs/wm8731-spi.c  | 2 +-
 sound/soc/codecs/wm8737.c  | 2 +-
 sound/soc/codecs/wm8741.c  | 2 +-
 sound/soc/codecs/wm8750.c  | 2 +-
 sound/soc/codecs/wm8753.c  | 2 +-
 sound/soc/codecs/wm8770.c  | 2 +-
 sound/soc/codecs/wm8776.c  | 2 +-
 sound/soc/codecs/wm8804.c  | 1 -
 sound/soc/fsl/efika-audio-fabric.c | 4 ++--
 sound/soc/fsl/fsl_aud2htx.c| 3 +--
 sound/soc/fsl/fsl_mqs.c| 2 +-
 sound/soc/fsl/fsl_rpmsg.c  | 3 +--
 sound/soc/fsl/fsl_sai.c| 3 +--
 sound/soc/fsl/fsl_spdif.c  | 4 +---

[PATCH RESEND 0/5] ASoC: DT matching and header cleanups

2023-10-03 Thread Rob Herring
(Got a bunch of bounces on the first try. Something weird going on with 
the To header best I can tell. Retrying with git-send-email instead of 
b4.)

This is a series is part of ongoing clean-ups related to device
matching and DT related implicit includes. Essentially of_device.h has
a bunch of implicit includes and generally isn't needed any nore except
for of_match_device(). As we also generally want to get rid of
of_match_device() as well, I've done that so we're not updating the
includes twice.

Signed-off-by: Rob Herring 
---
Rob Herring (5):
  ASoC: Explicitly include correct DT includes
  ASoC: Drop unnecessary of_match_device() calls
  ASoC: da7218: Use i2c_get_match_data()
  ASoC: qcom/lpass: Constify struct lpass_variant
  ASoC: Use device_get_match_data()

 sound/soc/atmel/atmel_wm8904.c |  1 -
 sound/soc/atmel/mchp-i2s-mcc.c |  2 +-
 sound/soc/atmel/tse850-pcm5142.c   |  1 -
 sound/soc/bcm/cygnus-ssp.c |  2 +-
 sound/soc/codecs/adau1701.c|  1 -
 sound/soc/codecs/adau1977-spi.c|  1 -
 sound/soc/codecs/ak4104.c  |  2 +-
 sound/soc/codecs/ak4118.c  |  2 +-
 sound/soc/codecs/ak4375.c  |  2 +-
 sound/soc/codecs/ak4458.c  |  2 +-
 sound/soc/codecs/ak4613.c  |  2 +-
 sound/soc/codecs/ak4642.c  |  2 +-
 sound/soc/codecs/ak5386.c  |  7 +---
 sound/soc/codecs/ak5558.c  |  2 +-
 sound/soc/codecs/cs35l32.c |  2 +-
 sound/soc/codecs/cs35l33.c |  2 -
 sound/soc/codecs/cs35l34.c |  2 +-
 sound/soc/codecs/cs35l35.c |  3 +-
 sound/soc/codecs/cs35l36.c |  3 +-
 sound/soc/codecs/cs35l41-i2c.c |  2 +-
 sound/soc/codecs/cs35l41.c |  1 -
 sound/soc/codecs/cs4270.c  |  2 +-
 sound/soc/codecs/cs4271.c  | 22 +++
 sound/soc/codecs/cs42l42.c |  1 -
 sound/soc/codecs/cs42l56.c |  2 +-
 sound/soc/codecs/cs42xx8-i2c.c |  2 +-
 sound/soc/codecs/cs43130.c |  3 +-
 sound/soc/codecs/cs4349.c  |  2 +-
 sound/soc/codecs/da7213.c  |  2 +-
 sound/soc/codecs/da7218.c  | 29 +--
 sound/soc/codecs/da7218.h  |  2 +-
 sound/soc/codecs/da7219.c  |  2 +-
 sound/soc/codecs/da9055.c  |  1 -
 sound/soc/codecs/es8328.c  |  1 -
 sound/soc/codecs/gtm601.c  |  2 +-
 sound/soc/codecs/lpass-macro-common.c  |  2 +-
 sound/soc/codecs/mt6351.c  |  2 +-
 sound/soc/codecs/mt6358.c  |  2 +-
 sound/soc/codecs/mt6359-accdet.c   |  4 --
 sound/soc/codecs/mt6359.c  |  2 +-
 sound/soc/codecs/nau8540.c |  2 +-
 sound/soc/codecs/pcm1681.c |  2 -
 sound/soc/codecs/rt715.c   |  2 -
 sound/soc/codecs/sgtl5000.c|  2 +-
 sound/soc/codecs/sma1303.c |  2 +-
 sound/soc/codecs/sta32x.c  |  3 +-
 sound/soc/codecs/sta350.c  |  3 +-
 sound/soc/codecs/tas5086.c |  6 +--
 sound/soc/codecs/tas571x.c |  2 +-
 sound/soc/codecs/uda1334.c |  2 +-
 sound/soc/codecs/wm8510.c  |  2 +-
 sound/soc/codecs/wm8523.c  |  2 +-
 sound/soc/codecs/wm8524.c  |  2 +-
 sound/soc/codecs/wm8580.c  |  2 +-
 sound/soc/codecs/wm8711.c  |  2 +-
 sound/soc/codecs/wm8728.c  |  2 +-
 sound/soc/codecs/wm8731-i2c.c  |  2 +-
 sound/soc/codecs/wm8731-spi.c  |  2 +-
 sound/soc/codecs/wm8737.c  |  2 +-
 sound/soc/codecs/wm8741.c  |  2 +-
 sound/soc/codecs/wm8750.c  |  2 +-
 sound/soc/codecs/wm8753.c  |  2 +-
 sound/soc/codecs/wm8770.c  |  2 +-
 sound/soc/codecs/wm8776.c  |  2 +-
 sound/soc/codecs/wm8804.c  |  1 -
 sound/soc/fsl/efika-audio-fabric.c |  4 +-
 sound/soc/fsl/fsl_aud2htx.c|  3 +-
 sound/soc/fsl/fsl_mqs.c|  2 +-
 sound/soc/fsl/fsl_rpmsg.c  |  3 +-
 sound/soc/fsl/fsl_sai.c

[PATCH 1/5] ASoC: Explicitly include correct DT includes

2023-10-03 Thread Rob Herring
The DT of_device.h and of_platform.h date back to the separate
of_platform_bus_type before it was merged into the regular platform bus.
As part of that merge prepping Arm DT support 13 years ago, they
"temporarily" include each other. They also include platform_device.h
and of.h. As a result, there's a pretty much random mix of those include
files used throughout the tree. In order to detangle these headers and
replace the implicit includes with struct declarations, users need to
explicitly include the correct includes.

Signed-off-by: Rob Herring 
---
 sound/soc/atmel/atmel_wm8904.c | 1 -
 sound/soc/atmel/mchp-i2s-mcc.c | 2 +-
 sound/soc/atmel/tse850-pcm5142.c   | 1 -
 sound/soc/bcm/cygnus-ssp.c | 2 +-
 sound/soc/codecs/adau1701.c| 1 -
 sound/soc/codecs/adau1977-spi.c| 1 -
 sound/soc/codecs/ak4104.c  | 2 +-
 sound/soc/codecs/ak4118.c  | 2 +-
 sound/soc/codecs/ak4375.c  | 2 +-
 sound/soc/codecs/ak4458.c  | 2 +-
 sound/soc/codecs/ak4613.c  | 2 +-
 sound/soc/codecs/ak4642.c  | 2 +-
 sound/soc/codecs/ak5558.c  | 2 +-
 sound/soc/codecs/cs35l32.c | 2 +-
 sound/soc/codecs/cs35l33.c | 2 --
 sound/soc/codecs/cs35l34.c | 2 +-
 sound/soc/codecs/cs35l35.c | 3 +--
 sound/soc/codecs/cs35l36.c | 3 +--
 sound/soc/codecs/cs35l41-i2c.c | 2 +-
 sound/soc/codecs/cs35l41.c | 1 -
 sound/soc/codecs/cs4270.c  | 2 +-
 sound/soc/codecs/cs42l42.c | 1 -
 sound/soc/codecs/cs42l56.c | 2 +-
 sound/soc/codecs/cs42xx8-i2c.c | 2 +-
 sound/soc/codecs/cs43130.c | 3 +--
 sound/soc/codecs/cs4349.c  | 2 +-
 sound/soc/codecs/da7213.c  | 2 +-
 sound/soc/codecs/da7219.c  | 2 +-
 sound/soc/codecs/da9055.c  | 1 -
 sound/soc/codecs/es8328.c  | 1 -
 sound/soc/codecs/gtm601.c  | 2 +-
 sound/soc/codecs/lpass-macro-common.c  | 2 +-
 sound/soc/codecs/mt6351.c  | 2 +-
 sound/soc/codecs/mt6358.c  | 2 +-
 sound/soc/codecs/mt6359-accdet.c   | 4 
 sound/soc/codecs/mt6359.c  | 2 +-
 sound/soc/codecs/nau8540.c | 2 +-
 sound/soc/codecs/pcm1681.c | 2 --
 sound/soc/codecs/rt715.c   | 2 --
 sound/soc/codecs/sgtl5000.c| 2 +-
 sound/soc/codecs/sma1303.c | 2 +-
 sound/soc/codecs/sta32x.c  | 3 +--
 sound/soc/codecs/sta350.c  | 3 +--
 sound/soc/codecs/tas571x.c | 2 +-
 sound/soc/codecs/uda1334.c | 2 +-
 sound/soc/codecs/wm8510.c  | 2 +-
 sound/soc/codecs/wm8523.c  | 2 +-
 sound/soc/codecs/wm8524.c  | 2 +-
 sound/soc/codecs/wm8580.c  | 2 +-
 sound/soc/codecs/wm8711.c  | 2 +-
 sound/soc/codecs/wm8728.c  | 2 +-
 sound/soc/codecs/wm8731-i2c.c  | 2 +-
 sound/soc/codecs/wm8731-spi.c  | 2 +-
 sound/soc/codecs/wm8737.c  | 2 +-
 sound/soc/codecs/wm8741.c  | 2 +-
 sound/soc/codecs/wm8750.c  | 2 +-
 sound/soc/codecs/wm8753.c  | 2 +-
 sound/soc/codecs/wm8770.c  | 2 +-
 sound/soc/codecs/wm8776.c  | 2 +-
 sound/soc/codecs/wm8804.c  | 1 -
 sound/soc/fsl/efika-audio-fabric.c | 4 ++--
 sound/soc/fsl/fsl_aud2htx.c| 3 +--
 sound/soc/fsl/fsl_mqs.c| 2 +-
 sound/soc/fsl/fsl_rpmsg.c  | 3 +--
 sound/soc/fsl/fsl_sai.c| 3 +--
 sound/soc/fsl/fsl_spdif.c  | 4 +---

[PATCH 3/5] ASoC: da7218: Use i2c_get_match_data()

2023-10-03 Thread Rob Herring
Use preferred i2c_get_match_data() instead of of_match_device() and
i2c_match_id() to get the driver match data. With this, adjust the
includes to explicitly include the correct headers.

Avoid using 0 for enum da7218_dev_id so that no match data can be
distinguished.

Signed-off-by: Rob Herring 
---
 sound/soc/codecs/da7218.c | 29 ++---
 sound/soc/codecs/da7218.h |  2 +-
 2 files changed, 3 insertions(+), 28 deletions(-)

diff --git a/sound/soc/codecs/da7218.c b/sound/soc/codecs/da7218.c
index 3f456b08b809..8aacd7350798 100644
--- a/sound/soc/codecs/da7218.c
+++ b/sound/soc/codecs/da7218.c
@@ -9,7 +9,7 @@
 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -2285,16 +2285,6 @@ static const struct of_device_id da7218_of_match[] = {
 };
 MODULE_DEVICE_TABLE(of, da7218_of_match);
 
-static inline int da7218_of_get_id(struct device *dev)
-{
-   const struct of_device_id *id = of_match_device(da7218_of_match, dev);
-
-   if (id)
-   return (uintptr_t)id->data;
-   else
-   return -EINVAL;
-}
-
 static enum da7218_micbias_voltage
da7218_of_micbias_lvl(struct snd_soc_component *component, u32 val)
 {
@@ -3253,18 +3243,6 @@ static const struct regmap_config da7218_regmap_config = 
{
  * I2C layer
  */
 
-static const struct i2c_device_id da7218_i2c_id[];
-
-static inline int da7218_i2c_get_id(struct i2c_client *i2c)
-{
-   const struct i2c_device_id *id = i2c_match_id(da7218_i2c_id, i2c);
-
-   if (id)
-   return (uintptr_t)id->driver_data;
-   else
-   return -EINVAL;
-}
-
 static int da7218_i2c_probe(struct i2c_client *i2c)
 {
struct da7218_priv *da7218;
@@ -3276,10 +3254,7 @@ static int da7218_i2c_probe(struct i2c_client *i2c)
 
i2c_set_clientdata(i2c, da7218);
 
-   if (i2c->dev.of_node)
-   da7218->dev_id = da7218_of_get_id(>dev);
-   else
-   da7218->dev_id = da7218_i2c_get_id(i2c);
+   da7218->dev_id = (uintptr_t)i2c_get_match_data(i2c);
 
if ((da7218->dev_id != DA7217_DEV_ID) &&
(da7218->dev_id != DA7218_DEV_ID)) {
diff --git a/sound/soc/codecs/da7218.h b/sound/soc/codecs/da7218.h
index 9ac2892092b5..7f6a4aea2c7a 100644
--- a/sound/soc/codecs/da7218.h
+++ b/sound/soc/codecs/da7218.h
@@ -1369,7 +1369,7 @@ enum da7218_sys_clk {
 };
 
 enum da7218_dev_id {
-   DA7217_DEV_ID = 0,
+   DA7217_DEV_ID = 1,
DA7218_DEV_ID,
 };
 

-- 
2.40.1



[PATCH 2/5] ASoC: Drop unnecessary of_match_device() calls

2023-10-03 Thread Rob Herring
If probe is reached, we've already matched the device and in the case of
DT matching, the struct device_node pointer will be set. Therefore, there
is no need to call of_match_device() in probe.

Signed-off-by: Rob Herring 
---
 sound/soc/codecs/ak5386.c  |  7 ++-
 sound/soc/codecs/cs4271.c  | 22 ++
 sound/soc/codecs/tas5086.c |  6 +-
 3 files changed, 9 insertions(+), 26 deletions(-)

diff --git a/sound/soc/codecs/ak5386.c b/sound/soc/codecs/ak5386.c
index 0c5e00679c7d..21a44476f48d 100644
--- a/sound/soc/codecs/ak5386.c
+++ b/sound/soc/codecs/ak5386.c
@@ -10,7 +10,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -168,7 +167,6 @@ static int ak5386_probe(struct platform_device *pdev)
if (!priv)
return -ENOMEM;
 
-   priv->reset_gpio = -EINVAL;
dev_set_drvdata(dev, priv);
 
for (i = 0; i < ARRAY_SIZE(supply_names); i++)
@@ -179,9 +177,8 @@ static int ak5386_probe(struct platform_device *pdev)
if (ret < 0)
return ret;
 
-   if (of_match_device(of_match_ptr(ak5386_dt_ids), dev))
-   priv->reset_gpio = of_get_named_gpio(dev->of_node,
- "reset-gpio", 0);
+   priv->reset_gpio = of_get_named_gpio(dev->of_node,
+"reset-gpio", 0);
 
if (gpio_is_valid(priv->reset_gpio))
if (devm_gpio_request_one(dev, priv->reset_gpio,
diff --git a/sound/soc/codecs/cs4271.c b/sound/soc/codecs/cs4271.c
index 188b8b43c524..9e6f8a048dd5 100644
--- a/sound/soc/codecs/cs4271.c
+++ b/sound/soc/codecs/cs4271.c
@@ -15,7 +15,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -563,19 +562,12 @@ static int cs4271_component_probe(struct 
snd_soc_component *component)
struct cs4271_private *cs4271 = 
snd_soc_component_get_drvdata(component);
struct cs4271_platform_data *cs4271plat = component->dev->platform_data;
int ret;
-   bool amutec_eq_bmutec = false;
+   bool amutec_eq_bmutec;
 
-#ifdef CONFIG_OF
-   if (of_match_device(cs4271_dt_ids, component->dev)) {
-   if (of_get_property(component->dev->of_node,
-"cirrus,amutec-eq-bmutec", NULL))
-   amutec_eq_bmutec = true;
-
-   if (of_get_property(component->dev->of_node,
-"cirrus,enable-soft-reset", NULL))
-   cs4271->enable_soft_reset = true;
-   }
-#endif
+   amutec_eq_bmutec = of_property_read_bool(component->dev->of_node,
+"cirrus,amutec-eq-bmutec");
+   cs4271->enable_soft_reset = 
of_property_read_bool(component->dev->of_node,
+ 
"cirrus,enable-soft-reset");
 
ret = regulator_bulk_enable(ARRAY_SIZE(cs4271->supplies),
cs4271->supplies);
@@ -655,9 +647,7 @@ static int cs4271_common_probe(struct device *dev,
if (!cs4271)
return -ENOMEM;
 
-   if (of_match_device(cs4271_dt_ids, dev))
-   cs4271->gpio_nreset =
-   of_get_named_gpio(dev->of_node, "reset-gpio", 0);
+   cs4271->gpio_nreset = of_get_named_gpio(dev->of_node, "reset-gpio", 0);
 
if (cs4271plat)
cs4271->gpio_nreset = cs4271plat->gpio_nreset;
diff --git a/sound/soc/codecs/tas5086.c b/sound/soc/codecs/tas5086.c
index 60e59e993ba6..f52c14b43f28 100644
--- a/sound/soc/codecs/tas5086.c
+++ b/sound/soc/codecs/tas5086.c
@@ -940,11 +940,7 @@ static int tas5086_i2c_probe(struct i2c_client *i2c)
 
i2c_set_clientdata(i2c, priv);
 
-   if (of_match_device(of_match_ptr(tas5086_dt_ids), dev)) {
-   struct device_node *of_node = dev->of_node;
-   gpio_nreset = of_get_named_gpio(of_node, "reset-gpio", 0);
-   }
-
+   gpio_nreset = of_get_named_gpio(dev->of_node, "reset-gpio", 0);
if (gpio_is_valid(gpio_nreset))
if (devm_gpio_request(dev, gpio_nreset, "TAS5086 Reset"))
gpio_nreset = -EINVAL;

-- 
2.40.1



[PATCH 4/5] ASoC: qcom/lpass: Constify struct lpass_variant

2023-10-03 Thread Rob Herring
'struct lpass_variant' is used for driver match data which is supposed to
be constant. It's not modified anywhere, so it's just a matter of adding
'const' everywhere.

Signed-off-by: Rob Herring 
---
 sound/soc/qcom/lpass-apq8016.c  |  6 +++---
 sound/soc/qcom/lpass-cdc-dma.c  |  2 +-
 sound/soc/qcom/lpass-cpu.c  | 28 ++--
 sound/soc/qcom/lpass-ipq806x.c  |  2 +-
 sound/soc/qcom/lpass-platform.c | 36 ++--
 sound/soc/qcom/lpass-sc7180.c   |  6 +++---
 sound/soc/qcom/lpass-sc7280.c   |  6 +++---
 sound/soc/qcom/lpass.h  |  2 +-
 8 files changed, 44 insertions(+), 44 deletions(-)

diff --git a/sound/soc/qcom/lpass-apq8016.c b/sound/soc/qcom/lpass-apq8016.c
index f919d46e18ca..8ce75b442b64 100644
--- a/sound/soc/qcom/lpass-apq8016.c
+++ b/sound/soc/qcom/lpass-apq8016.c
@@ -123,7 +123,7 @@ static struct snd_soc_dai_driver 
apq8016_lpass_cpu_dai_driver[] = {
 static int apq8016_lpass_alloc_dma_channel(struct lpass_data *drvdata,
   int direction, unsigned int dai_id)
 {
-   struct lpass_variant *v = drvdata->variant;
+   const struct lpass_variant *v = drvdata->variant;
int chan = 0;
 
if (direction == SNDRV_PCM_STREAM_PLAYBACK) {
@@ -157,7 +157,7 @@ static int apq8016_lpass_free_dma_channel(struct lpass_data 
*drvdata, int chan,
 static int apq8016_lpass_init(struct platform_device *pdev)
 {
struct lpass_data *drvdata = platform_get_drvdata(pdev);
-   struct lpass_variant *variant = drvdata->variant;
+   const struct lpass_variant *variant = drvdata->variant;
struct device *dev = >dev;
int ret, i;
 
@@ -223,7 +223,7 @@ static int apq8016_lpass_exit(struct platform_device *pdev)
 }
 
 
-static struct lpass_variant apq8016_data = {
+static const struct lpass_variant apq8016_data = {
.i2sctrl_reg_base   = 0x1000,
.i2sctrl_reg_stride = 0x1000,
.i2s_ports  = 4,
diff --git a/sound/soc/qcom/lpass-cdc-dma.c b/sound/soc/qcom/lpass-cdc-dma.c
index 8221e2cbe35c..6389c7b6051e 100644
--- a/sound/soc/qcom/lpass-cdc-dma.c
+++ b/sound/soc/qcom/lpass-cdc-dma.c
@@ -37,7 +37,7 @@ static void __lpass_get_dmactl_handle(struct 
snd_pcm_substream *substream, struc
struct lpass_data *drvdata = snd_soc_dai_get_drvdata(dai);
struct snd_pcm_runtime *rt = substream->runtime;
struct lpass_pcm_data *pcm_data = rt->private_data;
-   struct lpass_variant *v = drvdata->variant;
+   const struct lpass_variant *v = drvdata->variant;
unsigned int dai_id = cpu_dai->driver->id;
 
switch (dai_id) {
diff --git a/sound/soc/qcom/lpass-cpu.c b/sound/soc/qcom/lpass-cpu.c
index 39571fed4001..18aff2654f89 100644
--- a/sound/soc/qcom/lpass-cpu.c
+++ b/sound/soc/qcom/lpass-cpu.c
@@ -44,7 +44,7 @@ static int lpass_cpu_init_i2sctl_bitfields(struct device *dev,
struct lpaif_i2sctl *i2sctl, struct regmap *map)
 {
struct lpass_data *drvdata = dev_get_drvdata(dev);
-   struct lpass_variant *v = drvdata->variant;
+   const struct lpass_variant *v = drvdata->variant;
 
i2sctl->loopback = devm_regmap_field_alloc(dev, map, v->loopback);
i2sctl->spken = devm_regmap_field_alloc(dev, map, v->spken);
@@ -463,7 +463,7 @@ static int asoc_qcom_of_xlate_dai_name(struct 
snd_soc_component *component,
   const char **dai_name)
 {
struct lpass_data *drvdata = snd_soc_component_get_drvdata(component);
-   struct lpass_variant *variant = drvdata->variant;
+   const struct lpass_variant *variant = drvdata->variant;
int id = args->args[0];
int ret = -EINVAL;
int i;
@@ -488,7 +488,7 @@ static const struct snd_soc_component_driver 
lpass_cpu_comp_driver = {
 static bool lpass_cpu_regmap_writeable(struct device *dev, unsigned int reg)
 {
struct lpass_data *drvdata = dev_get_drvdata(dev);
-   struct lpass_variant *v = drvdata->variant;
+   const struct lpass_variant *v = drvdata->variant;
int i;
 
for (i = 0; i < v->i2s_ports; ++i)
@@ -530,7 +530,7 @@ static bool lpass_cpu_regmap_writeable(struct device *dev, 
unsigned int reg)
 static bool lpass_cpu_regmap_readable(struct device *dev, unsigned int reg)
 {
struct lpass_data *drvdata = dev_get_drvdata(dev);
-   struct lpass_variant *v = drvdata->variant;
+   const struct lpass_variant *v = drvdata->variant;
int i;
 
for (i = 0; i < v->i2s_ports; ++i)
@@ -578,7 +578,7 @@ static bool lpass_cpu_regmap_readable(struct device *dev, 
unsigned int reg)
 static bool lpass_cpu_regmap_volatile(struct device *dev, unsigned int reg)
 {
struct lpass_data *drvdata = dev_get_drvdata(dev);
-   struct lpass_variant *v = drvdata->variant;
+   const struct lpass_variant *v = drvdata->variant;
int i;
 
  

[PATCH 5/5] ASoC: Use device_get_match_data()

2023-10-03 Thread Rob Herring
Use preferred device_get_match_data() instead of of_match_device() to
get the driver match data. With this, adjust the includes to explicitly
include the correct headers.

Signed-off-by: Rob Herring 
---
 sound/soc/intel/keembay/kmb_platform.c | 13 +
 sound/soc/qcom/lpass-cpu.c | 15 +--
 sound/soc/rockchip/rockchip_i2s.c  |  8 +++-
 sound/soc/rockchip/rockchip_i2s_tdm.c  | 20 +++-
 sound/soc/rockchip/rockchip_pdm.c  |  6 +-
 sound/soc/samsung/smdk_wm8994.c| 27 +++
 sound/soc/stm/stm32_i2s.c  |  7 ++-
 sound/soc/stm/stm32_sai.c  |  8 
 sound/soc/stm/stm32_sai_sub.c  |  6 +-
 sound/soc/stm/stm32_spdifrx.c  |  8 ++--
 sound/soc/tegra/tegra210_amx.c |  7 +--
 sound/soc/ti/davinci-evm.c |  7 ++-
 sound/soc/ti/davinci-mcasp.c   |  9 -
 sound/soc/ti/omap-mcbsp.c  | 10 --
 14 files changed, 40 insertions(+), 111 deletions(-)

diff --git a/sound/soc/intel/keembay/kmb_platform.c 
b/sound/soc/intel/keembay/kmb_platform.c
index e929497a5eb5..37ea2e1d2e92 100644
--- a/sound/soc/intel/keembay/kmb_platform.c
+++ b/sound/soc/intel/keembay/kmb_platform.c
@@ -11,7 +11,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -820,7 +819,6 @@ static int kmb_plat_dai_probe(struct platform_device *pdev)
 {
struct device_node *np = pdev->dev.of_node;
struct snd_soc_dai_driver *kmb_i2s_dai;
-   const struct of_device_id *match;
struct device *dev = >dev;
struct kmb_i2s_info *kmb_i2s;
struct resource *res;
@@ -831,16 +829,7 @@ static int kmb_plat_dai_probe(struct platform_device *pdev)
if (!kmb_i2s)
return -ENOMEM;
 
-   kmb_i2s_dai = devm_kzalloc(dev, sizeof(*kmb_i2s_dai), GFP_KERNEL);
-   if (!kmb_i2s_dai)
-   return -ENOMEM;
-
-   match = of_match_device(kmb_plat_of_match, >dev);
-   if (!match) {
-   dev_err(>dev, "Error: No device match found\n");
-   return -ENODEV;
-   }
-   kmb_i2s_dai = (struct snd_soc_dai_driver *) match->data;
+   kmb_i2s_dai = (struct snd_soc_dai_driver 
*)device_get_match_data(>dev);
 
/* Prepare the related clocks */
kmb_i2s->clk_apb = devm_clk_get(dev, "apb_clk");
diff --git a/sound/soc/qcom/lpass-cpu.c b/sound/soc/qcom/lpass-cpu.c
index 18aff2654f89..ac0feb89b458 100644
--- a/sound/soc/qcom/lpass-cpu.c
+++ b/sound/soc/qcom/lpass-cpu.c
@@ -9,7 +9,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -1106,7 +1105,6 @@ int asoc_qcom_lpass_cpu_platform_probe(struct 
platform_device *pdev)
struct resource *res;
const struct lpass_variant *variant;
struct device *dev = >dev;
-   const struct of_device_id *match;
int ret, i, dai_id;
 
dsp_of_node = of_parse_phandle(pdev->dev.of_node, "qcom,adsp", 0);
@@ -1121,17 +1119,14 @@ int asoc_qcom_lpass_cpu_platform_probe(struct 
platform_device *pdev)
return -ENOMEM;
platform_set_drvdata(pdev, drvdata);
 
-   match = of_match_device(dev->driver->of_match_table, dev);
-   if (!match || !match->data)
+   variant = device_get_match_data(dev);
+   if (!variant)
return -EINVAL;
 
-   if (of_device_is_compatible(dev->of_node, "qcom,lpass-cpu-apq8016")) {
-   dev_warn(dev, "%s compatible is deprecated\n",
-match->compatible);
-   }
+   if (of_device_is_compatible(dev->of_node, "qcom,lpass-cpu-apq8016"))
+   dev_warn(dev, "qcom,lpass-cpu-apq8016 compatible is 
deprecated\n");
 
-   drvdata->variant = (struct lpass_variant *)match->data;
-   variant = drvdata->variant;
+   drvdata->variant = variant;
 
of_lpass_cpu_parse_dai_data(dev, drvdata);
 
diff --git a/sound/soc/rockchip/rockchip_i2s.c 
b/sound/soc/rockchip/rockchip_i2s.c
index 74e7d6ee0f28..b0c3ef030e06 100644
--- a/sound/soc/rockchip/rockchip_i2s.c
+++ b/sound/soc/rockchip/rockchip_i2s.c
@@ -10,8 +10,8 @@
 #include 
 #include 
 #include 
+#include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -736,7 +736,6 @@ static int rockchip_i2s_init_dai(struct rk_i2s_dev *i2s, 
struct resource *res,
 static int rockchip_i2s_probe(struct platform_device *pdev)
 {
struct device_node *node = pdev->dev.of_node;
-   const struct of_device_id *of_id;
struct rk_i2s_dev *i2s;
struct snd_soc_dai_driver *dai;
struct resource *res;
@@ -752,11 +751,10 @@ static int rockchip_i2s_probe(struct platform_device 
*pdev)
 
i2s->grf = syscon_regmap_lookup_by_phandle(node, "rockchip,grf");
if (!IS_ERR(i2s->grf)) {
-   of_

[PATCH 0/5] ASoC: DT matching and header cleanups

2023-10-03 Thread Rob Herring
This is a series is part of ongoing clean-ups related to device 
matching and DT related implicit includes. Essentially of_device.h has 
a bunch of implicit includes and generally isn't needed any nore except 
for of_match_device(). As we also generally want to get rid of 
of_match_device() as well, I've done that so we're not updating the 
includes twice.

Signed-off-by: Rob Herring 
---
Rob Herring (5):
  ASoC: Explicitly include correct DT includes
  ASoC: Drop unnecessary of_match_device() calls
  ASoC: da7218: Use i2c_get_match_data()
  ASoC: qcom/lpass: Constify struct lpass_variant
  ASoC: Use device_get_match_data()

 sound/soc/atmel/atmel_wm8904.c |  1 -
 sound/soc/atmel/mchp-i2s-mcc.c |  2 +-
 sound/soc/atmel/tse850-pcm5142.c   |  1 -
 sound/soc/bcm/cygnus-ssp.c |  2 +-
 sound/soc/codecs/adau1701.c|  1 -
 sound/soc/codecs/adau1977-spi.c|  1 -
 sound/soc/codecs/ak4104.c  |  2 +-
 sound/soc/codecs/ak4118.c  |  2 +-
 sound/soc/codecs/ak4375.c  |  2 +-
 sound/soc/codecs/ak4458.c  |  2 +-
 sound/soc/codecs/ak4613.c  |  2 +-
 sound/soc/codecs/ak4642.c  |  2 +-
 sound/soc/codecs/ak5386.c  |  7 +---
 sound/soc/codecs/ak5558.c  |  2 +-
 sound/soc/codecs/cs35l32.c |  2 +-
 sound/soc/codecs/cs35l33.c |  2 -
 sound/soc/codecs/cs35l34.c |  2 +-
 sound/soc/codecs/cs35l35.c |  3 +-
 sound/soc/codecs/cs35l36.c |  3 +-
 sound/soc/codecs/cs35l41-i2c.c |  2 +-
 sound/soc/codecs/cs35l41.c |  1 -
 sound/soc/codecs/cs4270.c  |  2 +-
 sound/soc/codecs/cs4271.c  | 22 +++
 sound/soc/codecs/cs42l42.c |  1 -
 sound/soc/codecs/cs42l56.c |  2 +-
 sound/soc/codecs/cs42xx8-i2c.c |  2 +-
 sound/soc/codecs/cs43130.c |  3 +-
 sound/soc/codecs/cs4349.c  |  2 +-
 sound/soc/codecs/da7213.c  |  2 +-
 sound/soc/codecs/da7218.c  | 29 +--
 sound/soc/codecs/da7218.h  |  2 +-
 sound/soc/codecs/da7219.c  |  2 +-
 sound/soc/codecs/da9055.c  |  1 -
 sound/soc/codecs/es8328.c  |  1 -
 sound/soc/codecs/gtm601.c  |  2 +-
 sound/soc/codecs/lpass-macro-common.c  |  2 +-
 sound/soc/codecs/mt6351.c  |  2 +-
 sound/soc/codecs/mt6358.c  |  2 +-
 sound/soc/codecs/mt6359-accdet.c   |  4 --
 sound/soc/codecs/mt6359.c  |  2 +-
 sound/soc/codecs/nau8540.c |  2 +-
 sound/soc/codecs/pcm1681.c |  2 -
 sound/soc/codecs/rt715.c   |  2 -
 sound/soc/codecs/sgtl5000.c|  2 +-
 sound/soc/codecs/sma1303.c |  2 +-
 sound/soc/codecs/sta32x.c  |  3 +-
 sound/soc/codecs/sta350.c  |  3 +-
 sound/soc/codecs/tas5086.c |  6 +--
 sound/soc/codecs/tas571x.c |  2 +-
 sound/soc/codecs/uda1334.c |  2 +-
 sound/soc/codecs/wm8510.c  |  2 +-
 sound/soc/codecs/wm8523.c  |  2 +-
 sound/soc/codecs/wm8524.c  |  2 +-
 sound/soc/codecs/wm8580.c  |  2 +-
 sound/soc/codecs/wm8711.c  |  2 +-
 sound/soc/codecs/wm8728.c  |  2 +-
 sound/soc/codecs/wm8731-i2c.c  |  2 +-
 sound/soc/codecs/wm8731-spi.c  |  2 +-
 sound/soc/codecs/wm8737.c  |  2 +-
 sound/soc/codecs/wm8741.c  |  2 +-
 sound/soc/codecs/wm8750.c  |  2 +-
 sound/soc/codecs/wm8753.c  |  2 +-
 sound/soc/codecs/wm8770.c  |  2 +-
 sound/soc/codecs/wm8776.c  |  2 +-
 sound/soc/codecs/wm8804.c  |  1 -
 sound/soc/fsl/efika-audio-fabric.c |  4 +-
 sound/soc/fsl/fsl_aud2htx.c|  3 +-
 sound/soc/fsl/fsl_mqs.c|  2 +-
 sound/soc/fsl/fsl_rpmsg.c  |  3 +-
 sound/soc/fsl/fsl_sai.c|  3 +-
 sound/soc/fsl/fsl_spdif.c  |  4 +-
 sound/soc/fsl/imx-audmux.c |  1 -
 sound/soc

[PATCH] ALSA: aoa: Replace asm/prom.h with explicit includes

2023-10-03 Thread Rob Herring
asm/prom.h should not be included directly as it no longer contains
anything drivers need. Drivers should include of.h and/or other headers
which were getting implicitly included.

Signed-off-by: Rob Herring 
---
 sound/aoa/aoa-gpio.h| 1 -
 sound/aoa/aoa.h | 1 -
 sound/aoa/codecs/onyx.c | 1 +
 sound/aoa/codecs/onyx.h | 1 -
 sound/aoa/codecs/tas.c  | 2 +-
 sound/aoa/fabrics/layout.c  | 3 ++-
 sound/aoa/soundbus/core.c   | 2 ++
 sound/aoa/soundbus/i2sbus/control.c | 1 -
 sound/aoa/soundbus/i2sbus/core.c| 1 +
 sound/aoa/soundbus/i2sbus/i2sbus.h  | 1 -
 sound/aoa/soundbus/soundbus.h   | 2 +-
 11 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/sound/aoa/aoa-gpio.h b/sound/aoa/aoa-gpio.h
index 54f9a78fa08e..77ae75d7594c 100644
--- a/sound/aoa/aoa-gpio.h
+++ b/sound/aoa/aoa-gpio.h
@@ -9,7 +9,6 @@
 #define __AOA_GPIO_H
 #include 
 #include 
-#include 
 
 typedef void (*notify_func_t)(void *data);
 
diff --git a/sound/aoa/aoa.h b/sound/aoa/aoa.h
index 3d2d03ff6337..badff9f7cd54 100644
--- a/sound/aoa/aoa.h
+++ b/sound/aoa/aoa.h
@@ -7,7 +7,6 @@
 
 #ifndef __AOA_H
 #define __AOA_H
-#include 
 #include 
 #include 
 #include 
diff --git a/sound/aoa/codecs/onyx.c b/sound/aoa/codecs/onyx.c
index a8a59d71dcec..e90e03bb0dc0 100644
--- a/sound/aoa/codecs/onyx.c
+++ b/sound/aoa/codecs/onyx.c
@@ -30,6 +30,7 @@
  */
 #include 
 #include 
+#include 
 #include 
 MODULE_AUTHOR("Johannes Berg ");
 MODULE_LICENSE("GPL");
diff --git a/sound/aoa/codecs/onyx.h b/sound/aoa/codecs/onyx.h
index 6c31b7373b78..bbdca841fe90 100644
--- a/sound/aoa/codecs/onyx.h
+++ b/sound/aoa/codecs/onyx.h
@@ -8,7 +8,6 @@
 #define __SND_AOA_CODEC_ONYX_H
 #include 
 #include 
-#include 
 
 /* PCM3052 register definitions */
 
diff --git a/sound/aoa/codecs/tas.c b/sound/aoa/codecs/tas.c
index ab1472390061..be9822ebf9f8 100644
--- a/sound/aoa/codecs/tas.c
+++ b/sound/aoa/codecs/tas.c
@@ -60,10 +60,10 @@
  */
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
+#include 
 #include 
 
 MODULE_AUTHOR("Johannes Berg ");
diff --git a/sound/aoa/fabrics/layout.c b/sound/aoa/fabrics/layout.c
index 850dc8c53e9b..0cd19a05db19 100644
--- a/sound/aoa/fabrics/layout.c
+++ b/sound/aoa/fabrics/layout.c
@@ -7,9 +7,10 @@
  * This fabric module looks for sound codecs based on the
  * layout-id or device-id property in the device tree.
  */
-#include 
 #include 
 #include 
+#include 
+#include 
 #include 
 #include "../aoa.h"
 #include "../soundbus/soundbus.h"
diff --git a/sound/aoa/soundbus/core.c b/sound/aoa/soundbus/core.c
index 39fb8fe4e6ab..8f24a3eea16b 100644
--- a/sound/aoa/soundbus/core.c
+++ b/sound/aoa/soundbus/core.c
@@ -6,6 +6,8 @@
  */
 
 #include 
+#include 
+#include 
 #include "soundbus.h"
 
 MODULE_AUTHOR("Johannes Berg ");
diff --git a/sound/aoa/soundbus/i2sbus/control.c 
b/sound/aoa/soundbus/i2sbus/control.c
index 7d3abb8b2416..a003ef06de63 100644
--- a/sound/aoa/soundbus/i2sbus/control.c
+++ b/sound/aoa/soundbus/i2sbus/control.c
@@ -10,7 +10,6 @@
 #include 
 #include 
 
-#include 
 #include 
 #include 
 #include 
diff --git a/sound/aoa/soundbus/i2sbus/core.c b/sound/aoa/soundbus/i2sbus/core.c
index 51ed2f34b276..3f49a9e28bfc 100644
--- a/sound/aoa/soundbus/i2sbus/core.c
+++ b/sound/aoa/soundbus/i2sbus/core.c
@@ -10,6 +10,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
diff --git a/sound/aoa/soundbus/i2sbus/i2sbus.h 
b/sound/aoa/soundbus/i2sbus/i2sbus.h
index e86fdbb3b4c5..7a3cae0d6c26 100644
--- a/sound/aoa/soundbus/i2sbus/i2sbus.h
+++ b/sound/aoa/soundbus/i2sbus/i2sbus.h
@@ -13,7 +13,6 @@
 
 #include 
 
-#include 
 #include 
 #include 
 
diff --git a/sound/aoa/soundbus/soundbus.h b/sound/aoa/soundbus/soundbus.h
index db40f9d042b4..877cbad93f12 100644
--- a/sound/aoa/soundbus/soundbus.h
+++ b/sound/aoa/soundbus/soundbus.h
@@ -7,7 +7,7 @@
 #ifndef __SOUNDBUS_H
 #define __SOUNDBUS_H
 
-#include 
+#include 
 #include 
 #include 
 
-- 
2.40.1



Re: [PATCH v7 25/30] dt-bindings: net: Add the Lantiq PEF2256 E1/T1/J1 framer

2023-10-02 Thread Rob Herring


On Thu, 28 Sep 2023 09:06:43 +0200, Herve Codina wrote:
> The Lantiq PEF2256 is a framer and line interface component designed to
> fulfill all required interfacing between an analog E1/T1/J1 line and the
> digital PCM system highway/H.100 bus.
> 
> Signed-off-by: Herve Codina 
> Reviewed-by: Christophe Leroy 
> ---
>  .../bindings/net/lantiq,pef2256.yaml  | 213 ++
>  1 file changed, 213 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/net/lantiq,pef2256.yaml
> 

Reviewed-by: Rob Herring 



[PATCH] ASoC: dt-bindings: Add missing (unevaluated|additional)Properties on child node schemas

2023-09-25 Thread Rob Herring
Just as unevaluatedProperties or additionalProperties are required at
the top level of schemas, they should (and will) also be required for
child node schemas. That ensures only documented properties are
present for any node.

Add unevaluatedProperties or additionalProperties as appropriate.

Signed-off-by: Rob Herring 
---
 Documentation/devicetree/bindings/sound/dialog,da7219.yaml | 1 +
 Documentation/devicetree/bindings/sound/fsl,qmc-audio.yaml | 1 +
 Documentation/devicetree/bindings/sound/ti,pcm3168a.yaml   | 1 +
 3 files changed, 3 insertions(+)

diff --git a/Documentation/devicetree/bindings/sound/dialog,da7219.yaml 
b/Documentation/devicetree/bindings/sound/dialog,da7219.yaml
index eb7d219e2c86..19137abdba3e 100644
--- a/Documentation/devicetree/bindings/sound/dialog,da7219.yaml
+++ b/Documentation/devicetree/bindings/sound/dialog,da7219.yaml
@@ -89,6 +89,7 @@ properties:
 
   da7219_aad:
 type: object
+additionalProperties: false
 description:
   Configuration of advanced accessory detection.
 properties:
diff --git a/Documentation/devicetree/bindings/sound/fsl,qmc-audio.yaml 
b/Documentation/devicetree/bindings/sound/fsl,qmc-audio.yaml
index ff5cd9241941..b522ed7dcc51 100644
--- a/Documentation/devicetree/bindings/sound/fsl,qmc-audio.yaml
+++ b/Documentation/devicetree/bindings/sound/fsl,qmc-audio.yaml
@@ -33,6 +33,7 @@ patternProperties:
 description:
   A DAI managed by this controller
 type: object
+additionalProperties: false
 
 properties:
   reg:
diff --git a/Documentation/devicetree/bindings/sound/ti,pcm3168a.yaml 
b/Documentation/devicetree/bindings/sound/ti,pcm3168a.yaml
index b6a4360ab845..0b4f003989a4 100644
--- a/Documentation/devicetree/bindings/sound/ti,pcm3168a.yaml
+++ b/Documentation/devicetree/bindings/sound/ti,pcm3168a.yaml
@@ -60,6 +60,7 @@ properties:
 
   ports:
 $ref: audio-graph-port.yaml#/definitions/port-base
+unevaluatedProperties: false
 properties:
   port@0:
 $ref: audio-graph-port.yaml#
-- 
2.40.1



[PATCH v2] cpufreq: pmac32: Use of_property_read_reg() to parse "reg"

2023-09-25 Thread Rob Herring
Use the recently added of_property_read_reg() helper to get the
untranslated "reg" address value.

Acked-by: Viresh Kumar 
Signed-off-by: Rob Herring 
---
v2:
 - Add missing include
---
 drivers/cpufreq/pmac32-cpufreq.c | 7 +++
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/cpufreq/pmac32-cpufreq.c b/drivers/cpufreq/pmac32-cpufreq.c
index ec75e79659ac..df3567c1e93b 100644
--- a/drivers/cpufreq/pmac32-cpufreq.c
+++ b/drivers/cpufreq/pmac32-cpufreq.c
@@ -24,6 +24,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -378,10 +379,9 @@ static int pmac_cpufreq_cpu_init(struct cpufreq_policy 
*policy)
 
 static u32 read_gpio(struct device_node *np)
 {
-   const u32 *reg = of_get_property(np, "reg", NULL);
-   u32 offset;
+   u64 offset;
 
-   if (reg == NULL)
+   if (of_property_read_reg(np, 0, , NULL) < 0)
return 0;
/* That works for all keylargos but shall be fixed properly
 * some day... The problem is that it seems we can't rely
@@ -389,7 +389,6 @@ static u32 read_gpio(struct device_node *np)
 * relative to the base of KeyLargo or to the base of the
 * GPIO space, and the device-tree doesn't help.
 */
-   offset = *reg;
if (offset < KEYLARGO_GPIO_LEVELS0)
offset += KEYLARGO_GPIO_LEVELS0;
return offset;
-- 
2.40.1



Re: [PATCH v6 08/30] dt-bindings: soc: fsl: cpm_qe: cpm1-scc-qmc: Add support for QMC HDLC

2023-09-22 Thread Rob Herring


On Fri, 22 Sep 2023 09:58:43 +0200, Herve Codina wrote:
> The QMC (QUICC mutichannel controller) is a controller present in some
> PowerQUICC SoC such as MPC885.
> The QMC HDLC uses the QMC controller to transfer HDLC data.
> 
> Additionally, a framer can be connected to the QMC HDLC.
> If present, this framer is the interface between the TDM bus used by the
> QMC HDLC and the E1/T1 line.
> The QMC HDLC can use this framer to get information about the E1/T1 line
> and configure the E1/T1 line.
> 
> Signed-off-by: Herve Codina 
> ---
>  .../soc/fsl/cpm_qe/fsl,cpm1-scc-qmc.yaml  | 24 +++
>  1 file changed, 24 insertions(+)
> 

Reviewed-by: Rob Herring 



Re: [PATCH v6 25/30] dt-bindings: net: Add the Lantiq PEF2256 E1/T1/J1 framer

2023-09-22 Thread Rob Herring
On Fri, Sep 22, 2023 at 8:46 AM Herve Codina  wrote:
>
> Hi Rob,
>
> On Fri, 22 Sep 2023 07:33:32 -0500
> Rob Herring  wrote:
>
> > On Fri, 22 Sep 2023 09:59:00 +0200, Herve Codina wrote:
> > > The Lantiq PEF2256 is a framer and line interface component designed to
> > > fulfill all required interfacing between an analog E1/T1/J1 line and the
> > > digital PCM system highway/H.100 bus.
> > >
> > > Signed-off-by: Herve Codina 
> > > Reviewed-by: Christophe Leroy 
> > > ---
> > >  .../bindings/net/lantiq,pef2256.yaml  | 214 ++
> > >  1 file changed, 214 insertions(+)
> > >  create mode 100644 
> > > Documentation/devicetree/bindings/net/lantiq,pef2256.yaml
> > >
> >
> > My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
> > on your patch (DT_CHECKER_FLAGS is new in v5.13):
> >
> > yamllint warnings/errors:
> >
> > dtschema/dtc warnings/errors:
> > /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/lantiq,pef2256.yaml:
> >  properties:lantiq,data-rate-bps: '$ref' should not be valid under 
> > {'const': '$ref'}
> >   hint: Standard unit suffix properties don't need a type $ref
> >   from schema $id: http://devicetree.org/meta-schemas/core.yaml#
> >
>
> The '-bps' suffix was added recently in
> https://github.com/devicetree-org/dt-schema/
> commit 033d0b1 ("Add '-bps' as a standard unit suffix for bits per second")
>
> This commit is not yet present in any dt-schema release.
>
> Should I update my patch (ie. removing $ref) right now even if this update 
> will
> make the last dt-schema release not happy ?

Yes. I will spin a release soon as well.

Rob


Re: [PATCH v6 25/30] dt-bindings: net: Add the Lantiq PEF2256 E1/T1/J1 framer

2023-09-22 Thread Rob Herring


On Fri, 22 Sep 2023 09:59:00 +0200, Herve Codina wrote:
> The Lantiq PEF2256 is a framer and line interface component designed to
> fulfill all required interfacing between an analog E1/T1/J1 line and the
> digital PCM system highway/H.100 bus.
> 
> Signed-off-by: Herve Codina 
> Reviewed-by: Christophe Leroy 
> ---
>  .../bindings/net/lantiq,pef2256.yaml  | 214 ++
>  1 file changed, 214 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/net/lantiq,pef2256.yaml
> 

My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:

dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/lantiq,pef2256.yaml:
 properties:lantiq,data-rate-bps: '$ref' should not be valid under {'const': 
'$ref'}
hint: Standard unit suffix properties don't need a type $ref
from schema $id: http://devicetree.org/meta-schemas/core.yaml#

doc reference errors (make refcheckdocs):

See 
https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20230922075913.422435-26-herve.cod...@bootlin.com

The base for the series is generally the latest rc1. A different dependency
should be noted in *this* patch.

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:

pip3 install dtschema --upgrade

Please check and re-submit after running the above command yourself. Note
that DT_SCHEMA_FILES can be set to your schema file to speed up checking
your schema. However, it must be unset to test all examples with your schema.



Re: [PATCH v5 25/31] dt-bindings: net: Add the Lantiq PEF2256 E1/T1/J1 framer

2023-09-12 Thread Rob Herring
On Tue, Sep 12, 2023 at 07:13:32PM +0100, Conor Dooley wrote:
> Yo,
> 
> I'm not au fait enough with this to leave particularly meaningful
> comments, so just some minor ones for you.
> 
> On Tue, Sep 12, 2023 at 12:14:44PM +0200, Herve Codina wrote:
> > The Lantiq PEF2256 is a framer and line interface component designed to
> > fulfill all required interfacing between an analog E1/T1/J1 line and the
> > digital PCM system highway/H.100 bus.
> > 
> > Signed-off-by: Herve Codina 
> > Signed-off-by: Christophe Leroy 
> 
> Missing a co-developed-by?

Whomever sends the patch should have the last Sob.

> 
> > ---
> >  .../bindings/net/lantiq,pef2256.yaml  | 214 ++
> >  1 file changed, 214 insertions(+)
> >  create mode 100644 
> > Documentation/devicetree/bindings/net/lantiq,pef2256.yaml
> > 
> > diff --git a/Documentation/devicetree/bindings/net/lantiq,pef2256.yaml 
> > b/Documentation/devicetree/bindings/net/lantiq,pef2256.yaml
> > new file mode 100644
> > index ..c4f21678bf6a
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/net/lantiq,pef2256.yaml
> > @@ -0,0 +1,214 @@
> > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/net/lantiq,pef2256.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: Lantiq PEF2256
> > +
> > +maintainers:
> > +  - Herve Codina 
> > +
> > +description:
> > +  The Lantiq PEF2256, also known as Infineon PEF2256 or FALC56, is a 
> > framer and
> > +  line interface component designed to fulfill all required interfacing 
> > between
> > +  an analog E1/T1/J1 line and the digital PCM system highway/H.100 bus.
> > +
> > +properties:
> > +  compatible:
> > +items:
> > +  - const: lantiq,pef2256
> > +
> > +  reg:
> > +maxItems: 1
> > +
> > +  clocks:
> > +items:
> > +  - description: Master clock
> 
> My OCD is rather upset by the inconsistent capitalisation used here :/
> 
> > +  - description: System Clock Receive
> > +  - description: System Clock Transmit
> > +
> > +  clock-names:
> > +items:
> > +  - const: mclk
> > +  - const: sclkr
> > +  - const: sclkx
> > +
> > +  interrupts:
> > +maxItems: 1
> > +
> > +  reset-gpios:
> > +description:
> > +  GPIO used to reset the device.
> > +maxItems: 1
> > +
> > +  pinctrl:
> > +$ref: /schemas/pinctrl/pinctrl.yaml#
> > +additionalProperties: false
> > +
> > +patternProperties:
> > +  '-pins$':
> > +type: object
> > +$ref: /schemas/pinctrl/pinmux-node.yaml#
> > +additionalProperties: false
> > +
> > +properties:
> > +  pins:
> > +enum: [ RPA, RPB, RPC, RPD, XPA, XPB, XPC, XPD ]
> > +
> > +  function:
> > +enum: [ SYPR, RFM, RFMB, RSIGM, RSIG, DLR, FREEZE, RFSP, LOS,
> > +SYPX, XFMS, XSIG, TCLK, XMFB, XSIGM, DLX, XCLK, XLT,
> > +GPI, GPOH, GPOL ]
> > +
> > +required:
> > +  - pins
> > +  - function
> > +
> > +  lantiq,data-rate-bps:
> > +$ref: /schemas/types.yaml#/definitions/uint32
> > +enum: [2048000, 4096000, 8192000, 16384000]
> 
> -kBps is a standard suffix, would it be worth using that instead here?
> What you have would fit as even multiples.
> Otherwise Rob, should dt-schema grow -bps as a standard suffix?

Yeah, I think that makes sense. I've added it now.

Rob


Re: [PATCH v5 07/31] dt-bindings: soc: fsl: cpm_qe: cpm1-scc-qmc: Add 'additionalProperties: false' in child nodes

2023-09-12 Thread Rob Herring


On Tue, 12 Sep 2023 10:14:58 +0200, Herve Codina wrote:
> Additional properties in child node should not be allowed.
> 
> Prevent them adding 'additionalProperties: false'
> 
> Signed-off-by: Herve Codina 
> ---
>  .../devicetree/bindings/soc/fsl/cpm_qe/fsl,cpm1-scc-qmc.yaml | 1 +
>  1 file changed, 1 insertion(+)
> 

Acked-by: Rob Herring 



Re: [PATCH v5 06/31] dt-bindings: soc: fsl: cpm_qe: cpm1-scc-qmc: Fix example property name

2023-09-12 Thread Rob Herring
On Tue, Sep 12, 2023 at 12:58:32PM -0500, Rob Herring wrote:
> On Tue, Sep 12, 2023 at 10:14:57AM +0200, Herve Codina wrote:
> > The given example mentions the 'fsl,mode' property whereas the
> > correct property name, the one described, is 'fsl,operational-mode'.
> > 
> > Fix the example to use the correct property name.
> > 
> > Fixes: a9b121327c93 ("dt-bindings: soc: fsl: cpm_qe: Add QMC controller")
> > Signed-off-by: Herve Codina 
> > ---
> >  .../bindings/soc/fsl/cpm_qe/fsl,cpm1-scc-qmc.yaml   | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> I have this same fix in my tree, but you missed something. Please add 
> additionalProperties or unevaluatedProperties to the child node schema 
> so that this error is flagged.

NM, I see the next patch now.

Acked-by: Rob Herring 


Re: [PATCH v5 06/31] dt-bindings: soc: fsl: cpm_qe: cpm1-scc-qmc: Fix example property name

2023-09-12 Thread Rob Herring
On Tue, Sep 12, 2023 at 10:14:57AM +0200, Herve Codina wrote:
> The given example mentions the 'fsl,mode' property whereas the
> correct property name, the one described, is 'fsl,operational-mode'.
> 
> Fix the example to use the correct property name.
> 
> Fixes: a9b121327c93 ("dt-bindings: soc: fsl: cpm_qe: Add QMC controller")
> Signed-off-by: Herve Codina 
> ---
>  .../bindings/soc/fsl/cpm_qe/fsl,cpm1-scc-qmc.yaml   | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)

I have this same fix in my tree, but you missed something. Please add 
additionalProperties or unevaluatedProperties to the child node schema 
so that this error is flagged.

> 
> diff --git 
> a/Documentation/devicetree/bindings/soc/fsl/cpm_qe/fsl,cpm1-scc-qmc.yaml 
> b/Documentation/devicetree/bindings/soc/fsl/cpm_qe/fsl,cpm1-scc-qmc.yaml
> index ec888f48cac8..450a0354cb1d 100644
> --- a/Documentation/devicetree/bindings/soc/fsl/cpm_qe/fsl,cpm1-scc-qmc.yaml
> +++ b/Documentation/devicetree/bindings/soc/fsl/cpm_qe/fsl,cpm1-scc-qmc.yaml
> @@ -137,7 +137,7 @@ examples:
>  channel@16 {
>  /* Ch16 : First 4 even TS from all routed from TSA */
>  reg = <16>;
> -fsl,mode = "transparent";
> +fsl,operational-mode = "transparent";
>  fsl,reverse-data;
>  fsl,tx-ts-mask = <0x 0x00aa>;
>  fsl,rx-ts-mask = <0x 0x00aa>;
> @@ -146,7 +146,7 @@ examples:
>  channel@17 {
>  /* Ch17 : First 4 odd TS from all routed from TSA */
>  reg = <17>;
> -fsl,mode = "transparent";
> +fsl,operational-mode = "transparent";
>  fsl,reverse-data;
>  fsl,tx-ts-mask = <0x 0x0055>;
>  fsl,rx-ts-mask = <0x 0x0055>;
> @@ -155,7 +155,7 @@ examples:
>  channel@19 {
>  /* Ch19 : 8 TS (TS 8..15) from all routed from TSA */
>  reg = <19>;
> -fsl,mode = "hdlc";
> +fsl,operational-mode = "hdlc";
>  fsl,tx-ts-mask = <0x 0xff00>;
>  fsl,rx-ts-mask = <0x 0xff00>;
>  };
> -- 
> 2.41.0
> 


[PATCH v2] cpufreq: pmac32: Use of_property_read_reg() to parse "reg"

2023-09-08 Thread Rob Herring
Use the recently added of_property_read_reg() helper to get the
untranslated "reg" address value.

Acked-by: Viresh Kumar 
Signed-off-by: Rob Herring 
---
v2:
 - Add missing include
---
 drivers/cpufreq/pmac32-cpufreq.c | 7 +++
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/cpufreq/pmac32-cpufreq.c b/drivers/cpufreq/pmac32-cpufreq.c
index ec75e79659ac..df3567c1e93b 100644
--- a/drivers/cpufreq/pmac32-cpufreq.c
+++ b/drivers/cpufreq/pmac32-cpufreq.c
@@ -24,6 +24,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -378,10 +379,9 @@ static int pmac_cpufreq_cpu_init(struct cpufreq_policy 
*policy)
 
 static u32 read_gpio(struct device_node *np)
 {
-   const u32 *reg = of_get_property(np, "reg", NULL);
-   u32 offset;
+   u64 offset;
 
-   if (reg == NULL)
+   if (of_property_read_reg(np, 0, , NULL) < 0)
return 0;
/* That works for all keylargos but shall be fixed properly
 * some day... The problem is that it seems we can't rely
@@ -389,7 +389,6 @@ static u32 read_gpio(struct device_node *np)
 * relative to the base of KeyLargo or to the base of the
 * GPIO space, and the device-tree doesn't help.
 */
-   offset = *reg;
if (offset < KEYLARGO_GPIO_LEVELS0)
offset += KEYLARGO_GPIO_LEVELS0;
return offset;
-- 
2.40.1



Re: [PATCH] cpufreq: pmac32: Use of_property_read_reg() to parse "reg"

2023-08-23 Thread Rob Herring
On Sun, Jul 2, 2023 at 10:01 PM Viresh Kumar  wrote:
>
> On 09-06-23, 12:31, Rob Herring wrote:
> > Use the recently added of_property_read_reg() helper to get the
> > untranslated "reg" address value.
> >
> > Signed-off-by: Rob Herring 
> > ---
> >  drivers/cpufreq/pmac32-cpufreq.c | 5 ++---
> >  1 file changed, 2 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/cpufreq/pmac32-cpufreq.c 
> > b/drivers/cpufreq/pmac32-cpufreq.c
> > index ec75e79659ac..f53635ba16c1 100644
> > --- a/drivers/cpufreq/pmac32-cpufreq.c
> > +++ b/drivers/cpufreq/pmac32-cpufreq.c
> > @@ -378,10 +378,9 @@ static int pmac_cpufreq_cpu_init(struct cpufreq_policy 
> > *policy)
> >
> >  static u32 read_gpio(struct device_node *np)
> >  {
> > - const u32 *reg = of_get_property(np, "reg", NULL);
> > - u32 offset;
> > + u64 offset;
> >
> > - if (reg == NULL)
> > + if (of_property_read_reg(np, 0, , NULL) < 0)
> >   return 0;
> >   /* That works for all keylargos but shall be fixed properly
> >* some day... The problem is that it seems we can't rely
>
> Acked-by: Viresh Kumar 

Is someone going to apply this?

Rob


Re: [PATCH v4 22/28] dt-bindings: net: Add the Lantiq PEF2256 E1/T1/J1 framer

2023-08-21 Thread Rob Herring
On Fri, Aug 18, 2023 at 06:39:16PM +0200, Christophe Leroy wrote:
> From: Herve Codina 
> 
> The Lantiq PEF2256 is a framer and line interface component designed to
> fulfill all required interfacing between an analog E1/T1/J1 line and the
> digital PCM system highway/H.100 bus.
> 
> Signed-off-by: Herve Codina 
> Signed-off-by: Christophe Leroy 
> ---
>  .../bindings/net/lantiq,pef2256.yaml  | 219 ++
>  1 file changed, 219 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/net/lantiq,pef2256.yaml
> 
> diff --git a/Documentation/devicetree/bindings/net/lantiq,pef2256.yaml 
> b/Documentation/devicetree/bindings/net/lantiq,pef2256.yaml
> new file mode 100644
> index ..72f6777afa3a
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/net/lantiq,pef2256.yaml
> @@ -0,0 +1,219 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/net/lantiq,pef2256.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Lantiq PEF2256
> +
> +maintainers:
> +  - Herve Codina 
> +
> +description:
> +  The Lantiq PEF2256, also known as Infineon PEF2256 or FALC56, is a framer 
> and
> +  line interface component designed to fulfill all required interfacing 
> between
> +  an analog E1/T1/J1 line and the digital PCM system highway/H.100 bus.
> +
> +properties:
> +  compatible:
> +items:
> +  - const: lantiq,pef2256
> +
> +  reg:
> +maxItems: 1
> +
> +  clocks:
> +items:
> +  - description: Master clock
> +  - description: System Clock Receive
> +  - description: System Clock Transmit
> +
> +  clock-names:
> +items:
> +  - const: mclk
> +  - const: sclkr
> +  - const: sclkx
> +
> +  interrupts:
> +maxItems: 1
> +
> +  reset-gpios:
> +description:
> +  GPIO used to reset the device.
> +maxItems: 1
> +
> +  '#framer-cells':

Not a standard binding. Do you need provider specific variable number of 
cells?

> +const: 0
> +
> +  pinctrl:
> +$ref: /schemas/pinctrl/pinctrl.yaml#
> +additionalProperties: false
> +
> +patternProperties:
> +  '-pins$':
> +type: object
> +$ref: /schemas/pinctrl/pincfg-node.yaml#
> +additionalProperties: false
> +
> +properties:
> +  pins:
> +enum: [ RPA, RPB, RPC, RPD, XPA, XPB, XPC, XPD ]
> +
> +  function:
> +enum: [ SYPR, RFM, RFMB, RSIGM, RSIG, DLR, FREEZE, RFSP, LOS,
> +SYPX, XFMS, XSIG, TCLK, XMFB, XSIGM, DLX, XCLK, XLT,
> +GPI, GPOH, GPOL ]
> +
> +required:
> +  - pins
> +  - function
> +
> +  lantiq,data-rate-bps:
> +$ref: /schemas/types.yaml#/definitions/uint32
> +enum: [2048000, 4096000, 8192000, 16384000]
> +default: 2048000
> +description:
> +  Data rate (bit per seconds) on the system highway.
> +
> +  lantiq,clock-falling-edge:
> +$ref: /schemas/types.yaml#/definitions/flag
> +description:
> +  Data is sent on falling edge of the clock (and received on the rising
> +  edge). If 'clock-falling-edge' is not present, data is sent on the
> +  rising edge (and received on the falling edge).
> +
> +  lantiq,channel-phase:
> +$ref: /schemas/types.yaml#/definitions/uint32
> +enum: [0, 1, 2, 3, 4, 5, 6, 7]
> +default: 0
> +description:

Need '|' to preserve formatting

> +  The pef2256 delivers a full frame (32 8bit time-slots in E1 and 24 8bit
> +  time-slots 8 8bit signaling in E1/J1) every 125us. This lead to a data
> +  rate of 2048000 bit/s. When lantiq,data-rate-bps is more than 2048000
> +  bit/s, the data (all 32 8bit) present in the frame are interleave with
> +  unused time-slots. The lantiq,channel-phase property allows to set the
> +  correct alignment of the interleave mechanism.
> +  For instance, suppose lantiq,data-rate-bps = 8192000 (ie 4*2048000), 
> and
> +  lantiq,channel-phase = 2, the interleave schema with unused time-slots
> +  (nu) and used time-slots (XX) for TSi is
> +nu nu XX nu nu nu XX nu nu nu XX nu
> +<-- TSi --> <- TSi+1 -> <- TSi+2 ->
> +  With lantiq,data-rate-bps = 8192000, and lantiq,channel-phase = 1, the
> +  interleave schema is
> +nu XX nu nu nu XX nu nu nu XX nu nu
> +<-- TSi --> <- TSi+1 -> <- TSi+2 ->
> +  With lantiq,data-rate-bps = 4096000 (ie 2*2048000), and
> +  lantiq,channel-phase = 1, the interleave schema is
> +nuXXnuXXnuXX
> +<-- TSi --> <- TSi+1 -> <- TSi+2 ->
> +
> +patternProperties:
> +  '^codec(-([0-9]|[1-2][0-9]|3[0-1]))?$':
> +type: object
> +$ref: /schemas/sound/dai-common.yaml
> +unevaluatedProperties: false
> +description:
> +  Codec provided by the pef2256. This codec allows to use some of the PCM
> +  system highway time-slots as audio channels to transport audio data 
> over
> +  

Re: [PATCH v4 06/28] dt-bindings: net: Add support for QMC HDLC

2023-08-21 Thread Rob Herring
On Fri, Aug 18, 2023 at 06:39:00PM +0200, Christophe Leroy wrote:
> From: Herve Codina 
> 
> The QMC (QUICC mutichannel controller) is a controller present in some
> PowerQUICC SoC such as MPC885.
> The QMC HDLC uses the QMC controller to transfer HDLC data.
> 
> Additionally, a framer can be connected to the QMC HDLC.
> If present, this framer is the interface between the TDM bus used by the
> QMC HDLC and the E1/T1 line.
> The QMC HDLC can use this framer to get information about the E1/T1 line
> and configure the E1/T1 line.
> 
> Signed-off-by: Herve Codina 
> Signed-off-by: Christophe Leroy 
> ---
>  .../devicetree/bindings/net/fsl,qmc-hdlc.yaml | 46 +++
>  1 file changed, 46 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/net/fsl,qmc-hdlc.yaml
> 
> diff --git a/Documentation/devicetree/bindings/net/fsl,qmc-hdlc.yaml 
> b/Documentation/devicetree/bindings/net/fsl,qmc-hdlc.yaml
> new file mode 100644
> index ..13f3572f0feb
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/net/fsl,qmc-hdlc.yaml
> @@ -0,0 +1,46 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/net/fsl,qmc-hdlc.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Freescale/NXP QUICC Multichannel Controller (QMC) HDLC
> +
> +maintainers:
> +  - Herve Codina 
> +
> +description: |

Don't need '|'

> +  The QMC HDLC uses a QMC (QUICC Multichannel Controller) channel to transfer
> +  HDLC data.
> +
> +properties:
> +  compatible:
> +const: fsl,qmc-hdlc
> +
> +  fsl,qmc-chan:
> +$ref: /schemas/types.yaml#/definitions/phandle-array
> +items:
> +  - items:
> +  - description: phandle to QMC node
> +  - description: Channel number
> +description:
> +  Should be a phandle/number pair. The phandle to QMC node and the QMC
> +  channel to use.
> +
> +  framer:
> +$ref: /schemas/types.yaml#/definitions/phandle
> +description:
> +  phandle to the framer node

What's the framer? 

> +
> +required:
> +  - compatible
> +  - fsl,qmc-chan
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +hdlc {
> +compatible = "fsl,qmc-hdlc";
> +fsl,qmc-chan = < 16>;

Where does this node live? 

QMC is this[1]? Why don't you just add the compatible to channel@10 in 
the QMC node?

Rob

[1] Documentation/devicetree/bindings/soc/fsl/cpm_qe/fsl,cpm1-scc-qmc.yaml


Re: [PATCH v2 27/28] dt-bindings: net: fsl,qmc-hdlc: Add framer support

2023-08-02 Thread Rob Herring
On Wed, Jul 26, 2023 at 05:02:23PM +0200, Herve Codina wrote:
> A framer can be connected to the QMC HDLC.
> If present, this framer is the interface between the TDM used by the QMC
> HDLC and the E1/T1 line.
> The QMC HDLC can use this framer to get information about the line and
> configure the line.
> 
> Add an optional framer property to reference the framer itself.
> 
> Signed-off-by: Herve Codina 
> ---
>  Documentation/devicetree/bindings/net/fsl,qmc-hdlc.yaml | 5 +
>  1 file changed, 5 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/net/fsl,qmc-hdlc.yaml 
> b/Documentation/devicetree/bindings/net/fsl,qmc-hdlc.yaml
> index 8bb6f34602d9..bf29863ab419 100644
> --- a/Documentation/devicetree/bindings/net/fsl,qmc-hdlc.yaml
> +++ b/Documentation/devicetree/bindings/net/fsl,qmc-hdlc.yaml
> @@ -27,6 +27,11 @@ properties:
>Should be a phandle/number pair. The phandle to QMC node and the QMC
>channel to use.
>  
> +  framer:
> +$ref: /schemas/types.yaml#/definitions/phandle

Now you've defined this property twice. Please avoid doing that.

> +description:
> +  phandle to the framer node
> +
>  required:
>- compatible
>- fsl,qmc-chan
> -- 
> 2.41.0
> 


Re: [PATCH v2 21/28] dt-bindings: net: Add the Lantiq PEF2256 E1/T1/J1 framer

2023-08-02 Thread Rob Herring
On Wed, Jul 26, 2023 at 05:02:17PM +0200, Herve Codina wrote:
> The Lantiq PEF2256 is a framer and line interface component designed to
> fulfill all required interfacing between an analog E1/T1/J1 line and the
> digital PCM system highway/H.100 bus.
> 
> Signed-off-by: Herve Codina 
> ---
>  .../bindings/net/lantiq,pef2256.yaml  | 226 ++
>  1 file changed, 226 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/net/lantiq,pef2256.yaml
> 
> diff --git a/Documentation/devicetree/bindings/net/lantiq,pef2256.yaml 
> b/Documentation/devicetree/bindings/net/lantiq,pef2256.yaml
> new file mode 100644
> index ..b369a20d61b1
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/net/lantiq,pef2256.yaml
> @@ -0,0 +1,226 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/net/lantiq,pef2256.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Lantiq PEF2256
> +
> +maintainers:
> +  - Herve Codina 
> +
> +description:
> +  The Lantiq PEF2256, also known as Infineon PEF2256 or FALC56, is a framer 
> and
> +  line interface component designed to fulfill all required interfacing 
> between
> +  an analog E1/T1/J1 line and the digital PCM system highway/H.100 bus.
> +
> +properties:
> +  compatible:
> +items:
> +  - const: lantiq,pef2256
> +
> +  reg:
> +maxItems: 1
> +
> +  clocks:
> +items:
> +  - description: Master clock
> +  - description: Receive System Clock
> +  - description: Transmit System Clock
> +
> +  clock-names:
> +items:
> +  - const: mclk
> +  - const: sclkr
> +  - const: sclkx
> +
> +  interrupts:
> +maxItems: 1
> +
> +  reset-gpios:
> +description:
> +  GPIO used to reset the device.
> +maxItems: 1
> +
> +  '#framer-cells':

Looks generic, but no such property is defined. You don't need something 
like this unless there are multiple providers and you need each 
provider to define the number of cells.

> +const: 0
> +
> +  pinctrl:
> +$ref: /schemas/pinctrl/pinctrl.yaml#
> +additionalProperties: false
> +
> +patternProperties:
> +  '-pins$':
> +type: object
> +$ref: /schemas/pinctrl/pincfg-node.yaml#
> +additionalProperties: false
> +
> +properties:
> +  pins:
> +enum: [ RPA, RPB, RPC, RPD, XPA, XPB, XPC, XPD ]
> +
> +  function:
> +enum: [ SYPR, RFM, RFMB, RSIGM, RSIG, DLR, FREEZE, RFSP, LOS,
> +SYPX, XFMS, XSIG, TCLK, XMFB, XSIGM, DLX, XCLK, XLT,
> +GPI, GPOH, GPOL ]
> +
> +required:
> +  - pins
> +  - function
> +
> +  lantiq,data-rate-bps:
> +$ref: /schemas/types.yaml#/definitions/uint32
> +enum: [2048000, 4096000, 8192000, 16384000]
> +default: 2048000
> +description:
> +  Data rate (bit per seconds) on the system highway.
> +
> +  lantiq,clock-falling-edge:
> +$ref: /schemas/types.yaml#/definitions/flag
> +description:
> +  Data is sent on falling edge of the clock (and received on the rising
> +  edge). If 'clock-falling-edge' is not present, data is sent on the
> +  rising edge (and received on the falling edge).
> +
> +  lantiq,channel-phase:
> +$ref: /schemas/types.yaml#/definitions/uint32
> +enum: [0, 1, 2, 3, 4, 5, 6, 7]
> +default: 0
> +description:
> +  The pef2256 delivers a full frame (32 8bit time-slots in E1 and 24 8bit
> +  time-slots 8 8bit signaling in E1/J1) every 125us. This lead to a data
> +  rate of 2048000 bit/s. When lantiq,data-rate-bps is more than 2048000
> +  bit/s, the data (all 32 8bit) present in the frame are interleave with
> +  unused time-slots. The lantiq,channel-phase property allows to set the
> +  correct alignment of the interleave mechanism.
> +  For instance, suppose lantiq,data-rate-bps = 8192000 (ie 4*2048000), 
> and
> +  lantiq,channel-phase = 2, the interleave schema with unused time-slots
> +  (nu) and used time-slots (XX) for TSi is
> +nu nu XX nu nu nu XX nu nu nu XX nu
> +<-- TSi --> <- TSi+1 -> <- TSi+2 ->
> +  With lantiq,data-rate-bps = 8192000, and lantiq,channel-phase = 1, the
> +  interleave schema is
> +nu XX nu nu nu XX nu nu nu XX nu nu
> +<-- TSi --> <- TSi+1 -> <- TSi+2 ->
> +  With lantiq,data-rate-bps = 4096000 (ie 2*2048000), and
> +  lantiq,channel-phase = 1, the interleave schema is
> +nuXXnuXXnuXX
> +<-- TSi --> <- TSi+1 -> <- TSi+2 ->
> +
> +patternProperties:
> +  '^codec(-([0-9]|[1-2][0-9]|3[0-1]))?$':
> +type: object
> +$ref: /schemas/sound/dai-common.yaml
> +unevaluatedProperties: false
> +description:
> +  Codec provided by the pef2256. This codec allows to use some of the PCM
> +  system highway time-slots as audio channels to transport audio data 
> over
> +  

[PATCH v3] hwrng: Explicitly include correct DT includes

2023-07-28 Thread Rob Herring
The DT of_device.h and of_platform.h date back to the separate
of_platform_bus_type before it was merged into the regular platform bus.
As part of that merge prepping Arm DT support 13 years ago, they
"temporarily" include each other. They also include platform_device.h
and of.h. As a result, there's a pretty much random mix of those include
files used throughout the tree. In order to detangle these headers and
replace the implicit includes with struct declarations, users need to
explicitly include the correct includes.

Signed-off-by: Rob Herring 
---
v3:
 - Split out hw_random, ipmi and tpm
v2:
 - Fix build for pic32-rng.c dropping of_match_ptr()
---
 drivers/char/hw_random/atmel-rng.c | 2 +-
 drivers/char/hw_random/bcm2835-rng.c   | 3 +--
 drivers/char/hw_random/ingenic-trng.c  | 2 +-
 drivers/char/hw_random/iproc-rng200.c  | 3 +--
 drivers/char/hw_random/npcm-rng.c  | 3 +--
 drivers/char/hw_random/omap-rng.c  | 2 --
 drivers/char/hw_random/omap3-rom-rng.c | 1 -
 drivers/char/hw_random/pasemi-rng.c| 3 +--
 drivers/char/hw_random/pic32-rng.c | 5 ++---
 drivers/char/hw_random/stm32-rng.c | 3 ++-
 drivers/char/hw_random/xgene-rng.c | 5 ++---
 drivers/char/hw_random/xiphera-trng.c  | 1 -
 12 files changed, 12 insertions(+), 21 deletions(-)

diff --git a/drivers/char/hw_random/atmel-rng.c 
b/drivers/char/hw_random/atmel-rng.c
index b8effe77d80f..a37367ebcbac 100644
--- a/drivers/char/hw_random/atmel-rng.c
+++ b/drivers/char/hw_random/atmel-rng.c
@@ -15,7 +15,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 
diff --git a/drivers/char/hw_random/bcm2835-rng.c 
b/drivers/char/hw_random/bcm2835-rng.c
index e98fcac578d6..e19b0f9f48b9 100644
--- a/drivers/char/hw_random/bcm2835-rng.c
+++ b/drivers/char/hw_random/bcm2835-rng.c
@@ -8,8 +8,7 @@
 #include 
 #include 
 #include 
-#include 
-#include 
+#include 
 #include 
 #include 
 #include 
diff --git a/drivers/char/hw_random/ingenic-trng.c 
b/drivers/char/hw_random/ingenic-trng.c
index 0eb80f786f4d..759445d4f65a 100644
--- a/drivers/char/hw_random/ingenic-trng.c
+++ b/drivers/char/hw_random/ingenic-trng.c
@@ -11,8 +11,8 @@
 #include 
 #include 
 #include 
+#include 
 #include 
-#include 
 #include 
 #include 
 
diff --git a/drivers/char/hw_random/iproc-rng200.c 
b/drivers/char/hw_random/iproc-rng200.c
index 06bc060534d8..34df3f0d3e45 100644
--- a/drivers/char/hw_random/iproc-rng200.c
+++ b/drivers/char/hw_random/iproc-rng200.c
@@ -12,8 +12,7 @@
 #include 
 #include 
 #include 
-#include 
-#include 
+#include 
 #include 
 #include 
 
diff --git a/drivers/char/hw_random/npcm-rng.c 
b/drivers/char/hw_random/npcm-rng.c
index 9903d0357e06..8a304b754217 100644
--- a/drivers/char/hw_random/npcm-rng.c
+++ b/drivers/char/hw_random/npcm-rng.c
@@ -8,12 +8,11 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
-#include 
 #include 
-#include 
 
 #define NPCM_RNGCS_REG 0x00/* Control and status register */
 #define NPCM_RNGD_REG  0x04/* Data register */
diff --git a/drivers/char/hw_random/omap-rng.c 
b/drivers/char/hw_random/omap-rng.c
index 00ff96703dd2..be03f76a2a80 100644
--- a/drivers/char/hw_random/omap-rng.c
+++ b/drivers/char/hw_random/omap-rng.c
@@ -26,8 +26,6 @@
 #include 
 #include 
 #include 
-#include 
-#include 
 #include 
 #include 
 #include 
diff --git a/drivers/char/hw_random/omap3-rom-rng.c 
b/drivers/char/hw_random/omap3-rom-rng.c
index f06e4f95114f..18dc46b1b58e 100644
--- a/drivers/char/hw_random/omap3-rom-rng.c
+++ b/drivers/char/hw_random/omap3-rom-rng.c
@@ -20,7 +20,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 
diff --git a/drivers/char/hw_random/pasemi-rng.c 
b/drivers/char/hw_random/pasemi-rng.c
index 2498d4ef9fe2..6959d6edd44c 100644
--- a/drivers/char/hw_random/pasemi-rng.c
+++ b/drivers/char/hw_random/pasemi-rng.c
@@ -9,11 +9,10 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
-#include 
-#include 
 #include 
 
 #define SDCRNG_CTL_REG 0x00
diff --git a/drivers/char/hw_random/pic32-rng.c 
b/drivers/char/hw_random/pic32-rng.c
index 99c8bd0859a1..b314d994afcf 100644
--- a/drivers/char/hw_random/pic32-rng.c
+++ b/drivers/char/hw_random/pic32-rng.c
@@ -12,9 +12,8 @@
 #include 
 #include 
 #include 
+#include 
 #include 
-#include 
-#include 
 #include 
 #include 
 
@@ -129,7 +128,7 @@ static struct platform_driver pic32_rng_driver = {
.remove = pic32_rng_remove,
.driver = {
.name   = "pic32-rng",
-   .of_match_table = of_match_ptr(pic32_rng_of_match),
+   .of_match_table = pic32_rng_of_match,
},
 };
 
diff --git a/drivers/char/hw_random/stm32-rng.c 
b/drivers/char/hw_random/stm32-rng.c
index a6731cf0627a..efb6a9f9a11b 100644
--- a/drivers/char/hw_random/stm32-rng.c
+++ b/drivers/char/hw_random/stm32-rng.c
@@ -10,8 +10,9 @@
 #include 
 #include 
 #include 
+#include 
 #include 

[PATCH v2] char: Explicitly include correct DT includes

2023-07-26 Thread Rob Herring
The DT of_device.h and of_platform.h date back to the separate
of_platform_bus_type before it was merged into the regular platform bus.
As part of that merge prepping Arm DT support 13 years ago, they
"temporarily" include each other. They also include platform_device.h
and of.h. As a result, there's a pretty much random mix of those include
files used throughout the tree. In order to detangle these headers and
replace the implicit includes with struct declarations, users need to
explicitly include the correct includes.

Acked-by: Jarkko Sakkinen 
Signed-off-by: Rob Herring 
---
v2:
 - Fix build for pic32-rng.c dropping of_match_ptr()
---
 drivers/char/agp/uninorth-agp.c| 1 +
 drivers/char/bsr.c | 3 +--
 drivers/char/hw_random/atmel-rng.c | 2 +-
 drivers/char/hw_random/bcm2835-rng.c   | 3 +--
 drivers/char/hw_random/ingenic-trng.c  | 2 +-
 drivers/char/hw_random/iproc-rng200.c  | 3 +--
 drivers/char/hw_random/npcm-rng.c  | 3 +--
 drivers/char/hw_random/omap-rng.c  | 2 --
 drivers/char/hw_random/omap3-rom-rng.c | 1 -
 drivers/char/hw_random/pasemi-rng.c| 3 +--
 drivers/char/hw_random/pic32-rng.c | 5 ++---
 drivers/char/hw_random/stm32-rng.c | 3 ++-
 drivers/char/hw_random/xgene-rng.c | 5 ++---
 drivers/char/hw_random/xiphera-trng.c  | 1 -
 drivers/char/ipmi/kcs_bmc_aspeed.c | 1 -
 drivers/char/tpm/tpm_ftpm_tee.c| 1 -
 drivers/char/tpm/tpm_tis.c | 1 -
 drivers/char/tpm/tpm_tis_spi_main.c| 2 +-
 drivers/char/tpm/tpm_tis_synquacer.c   | 1 -
 19 files changed, 15 insertions(+), 28 deletions(-)

diff --git a/drivers/char/agp/uninorth-agp.c b/drivers/char/agp/uninorth-agp.c
index 62de7f4ba864..84411b13c49f 100644
--- a/drivers/char/agp/uninorth-agp.c
+++ b/drivers/char/agp/uninorth-agp.c
@@ -3,6 +3,7 @@
  * UniNorth AGPGART routines.
  */
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/drivers/char/bsr.c b/drivers/char/bsr.c
index 12143854aeac..70d31aed9011 100644
--- a/drivers/char/bsr.c
+++ b/drivers/char/bsr.c
@@ -6,11 +6,10 @@
  * Author: Sonny Rao 
  */
 
+#include 
 #include 
 #include 
 #include 
-#include 
-#include 
 #include 
 #include 
 #include 
diff --git a/drivers/char/hw_random/atmel-rng.c 
b/drivers/char/hw_random/atmel-rng.c
index b8effe77d80f..a37367ebcbac 100644
--- a/drivers/char/hw_random/atmel-rng.c
+++ b/drivers/char/hw_random/atmel-rng.c
@@ -15,7 +15,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 
diff --git a/drivers/char/hw_random/bcm2835-rng.c 
b/drivers/char/hw_random/bcm2835-rng.c
index e98fcac578d6..e19b0f9f48b9 100644
--- a/drivers/char/hw_random/bcm2835-rng.c
+++ b/drivers/char/hw_random/bcm2835-rng.c
@@ -8,8 +8,7 @@
 #include 
 #include 
 #include 
-#include 
-#include 
+#include 
 #include 
 #include 
 #include 
diff --git a/drivers/char/hw_random/ingenic-trng.c 
b/drivers/char/hw_random/ingenic-trng.c
index 0eb80f786f4d..759445d4f65a 100644
--- a/drivers/char/hw_random/ingenic-trng.c
+++ b/drivers/char/hw_random/ingenic-trng.c
@@ -11,8 +11,8 @@
 #include 
 #include 
 #include 
+#include 
 #include 
-#include 
 #include 
 #include 
 
diff --git a/drivers/char/hw_random/iproc-rng200.c 
b/drivers/char/hw_random/iproc-rng200.c
index 06bc060534d8..34df3f0d3e45 100644
--- a/drivers/char/hw_random/iproc-rng200.c
+++ b/drivers/char/hw_random/iproc-rng200.c
@@ -12,8 +12,7 @@
 #include 
 #include 
 #include 
-#include 
-#include 
+#include 
 #include 
 #include 
 
diff --git a/drivers/char/hw_random/npcm-rng.c 
b/drivers/char/hw_random/npcm-rng.c
index 9903d0357e06..8a304b754217 100644
--- a/drivers/char/hw_random/npcm-rng.c
+++ b/drivers/char/hw_random/npcm-rng.c
@@ -8,12 +8,11 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
-#include 
 #include 
-#include 
 
 #define NPCM_RNGCS_REG 0x00/* Control and status register */
 #define NPCM_RNGD_REG  0x04/* Data register */
diff --git a/drivers/char/hw_random/omap-rng.c 
b/drivers/char/hw_random/omap-rng.c
index 00ff96703dd2..be03f76a2a80 100644
--- a/drivers/char/hw_random/omap-rng.c
+++ b/drivers/char/hw_random/omap-rng.c
@@ -26,8 +26,6 @@
 #include 
 #include 
 #include 
-#include 
-#include 
 #include 
 #include 
 #include 
diff --git a/drivers/char/hw_random/omap3-rom-rng.c 
b/drivers/char/hw_random/omap3-rom-rng.c
index f06e4f95114f..18dc46b1b58e 100644
--- a/drivers/char/hw_random/omap3-rom-rng.c
+++ b/drivers/char/hw_random/omap3-rom-rng.c
@@ -20,7 +20,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 
diff --git a/drivers/char/hw_random/pasemi-rng.c 
b/drivers/char/hw_random/pasemi-rng.c
index 2498d4ef9fe2..6959d6edd44c 100644
--- a/drivers/char/hw_random/pasemi-rng.c
+++ b/drivers/char/hw_random/pasemi-rng.c
@@ -9,11 +9,10 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
-#include 
-#include 
 #include 
 
 #define SDCRNG_CTL_REG 0x00
diff --git a/drivers/char/hw_random/p

Re: [PATCH v2] net: Explicitly include correct DT includes

2023-07-25 Thread Rob Herring
On Tue, Jul 25, 2023 at 11:18 AM Simon Horman  wrote:
>
> On Mon, Jul 24, 2023 at 03:22:16PM -0600, Rob Herring wrote:
>
> ...
>
> >  90 files changed, 88 insertions(+), 92 deletions(-)
>
> Hi Rob,
>
> I suppose that it's reasonable to take this patch through netdev.
> But it does have a pretty wide surface, and netdev moves a lot.
>
> As it stands the patch doesn't apply due to a conflict
> in dwmac-qcom-ethqos.c

It did yesterday... Anyways, looks like 0-day decided to find something else.

Rob


[PATCH v3] powerpc: Explicitly include correct DT includes

2023-07-24 Thread Rob Herring
The DT of_device.h and of_platform.h date back to the separate
of_platform_bus_type before it as merged into the regular platform bus.
As part of that merge prepping Arm DT support 13 years ago, they
"temporarily" include each other. They also include platform_device.h
and of.h. As a result, there's a pretty much random mix of those include
files used throughout the tree. In order to detangle these headers and
replace the implicit includes with struct declarations, users need to
explicitly include the correct includes.

Signed-off-by: Rob Herring 
---
v3:
- Add 83xx/mpc832x_rdb.c, 85xx/common.c, 86xx/common.c
v2:
- Fix double include of of.h
---
 arch/powerpc/include/asm/ibmebus.h  | 2 ++
 arch/powerpc/include/asm/macio.h| 3 ++-
 arch/powerpc/kernel/legacy_serial.c | 2 +-
 arch/powerpc/kernel/of_platform.c   | 4 +---
 arch/powerpc/kernel/setup-common.c  | 4 ++--
 arch/powerpc/kexec/file_load_64.c   | 2 +-
 arch/powerpc/kexec/ranges.c | 2 +-
 arch/powerpc/platforms/4xx/cpm.c| 2 +-
 arch/powerpc/platforms/4xx/hsta_msi.c   | 2 +-
 arch/powerpc/platforms/4xx/soc.c| 2 +-
 arch/powerpc/platforms/512x/mpc5121_ads.c   | 2 +-
 arch/powerpc/platforms/512x/mpc512x_generic.c   | 2 +-
 arch/powerpc/platforms/512x/mpc512x_lpbfifo.c   | 2 +-
 arch/powerpc/platforms/512x/pdm360ng.c  | 3 ++-
 arch/powerpc/platforms/52xx/mpc52xx_gpt.c   | 3 +--
 arch/powerpc/platforms/82xx/ep8248e.c   | 1 +
 arch/powerpc/platforms/83xx/km83xx.c| 4 ++--
 arch/powerpc/platforms/83xx/mpc832x_rdb.c   | 4 +++-
 arch/powerpc/platforms/83xx/suspend.c   | 2 +-
 arch/powerpc/platforms/85xx/bsc913x_qds.c   | 2 +-
 arch/powerpc/platforms/85xx/bsc913x_rdb.c   | 2 +-
 arch/powerpc/platforms/85xx/c293pcie.c  | 3 +--
 arch/powerpc/platforms/85xx/common.c| 1 +
 arch/powerpc/platforms/85xx/ge_imp3a.c  | 2 +-
 arch/powerpc/platforms/85xx/ksi8560.c   | 3 ++-
 arch/powerpc/platforms/85xx/mpc8536_ds.c| 2 +-
 arch/powerpc/platforms/85xx/mpc85xx_ds.c| 2 +-
 arch/powerpc/platforms/85xx/mpc85xx_mds.c   | 4 ++--
 arch/powerpc/platforms/85xx/mpc85xx_rdb.c   | 3 ++-
 arch/powerpc/platforms/85xx/p1010rdb.c  | 2 +-
 arch/powerpc/platforms/85xx/p1022_ds.c  | 2 +-
 arch/powerpc/platforms/85xx/p1022_rdk.c | 2 +-
 arch/powerpc/platforms/85xx/p1023_rdb.c | 3 +--
 arch/powerpc/platforms/85xx/socrates.c  | 2 +-
 arch/powerpc/platforms/85xx/socrates_fpga_pic.c | 1 -
 arch/powerpc/platforms/85xx/stx_gp3.c   | 2 +-
 arch/powerpc/platforms/85xx/tqm85xx.c   | 2 +-
 arch/powerpc/platforms/85xx/twr_p102x.c | 3 ++-
 arch/powerpc/platforms/85xx/xes_mpc85xx.c   | 2 +-
 arch/powerpc/platforms/86xx/common.c| 3 +++
 arch/powerpc/platforms/86xx/gef_ppc9a.c | 2 +-
 arch/powerpc/platforms/86xx/gef_sbc310.c| 2 +-
 arch/powerpc/platforms/86xx/gef_sbc610.c| 2 +-
 arch/powerpc/platforms/86xx/mvme7100.c  | 1 -
 arch/powerpc/platforms/86xx/pic.c   | 2 +-
 arch/powerpc/platforms/cell/axon_msi.c  | 3 ++-
 arch/powerpc/platforms/cell/cbe_regs.c  | 3 +--
 arch/powerpc/platforms/cell/iommu.c | 2 +-
 arch/powerpc/platforms/cell/setup.c | 1 +
 arch/powerpc/platforms/cell/spider-pci.c| 1 -
 arch/powerpc/platforms/embedded6xx/holly.c  | 2 +-
 arch/powerpc/platforms/maple/setup.c| 4 ++--
 arch/powerpc/platforms/pasemi/gpio_mdio.c   | 2 +-
 arch/powerpc/platforms/pasemi/setup.c   | 2 ++
 arch/powerpc/platforms/powermac/setup.c | 2 +-
 arch/powerpc/platforms/powernv/opal-imc.c   | 1 -
 arch/powerpc/platforms/powernv/opal-rtc.c   | 3 ++-
 arch/powerpc/platforms/powernv/opal-secvar.c| 2 +-
 arch/powerpc/platforms/powernv/opal-sensor.c| 2 ++
 arch/powerpc/platforms/pseries/ibmebus.c| 1 +
 arch/powerpc/sysdev/cpm_common.c| 2 --
 arch/powerpc/sysdev/cpm_gpio.c  | 3 ++-
 arch/powerpc/sysdev/fsl_pmc.c   | 4 ++--
 arch/powerpc/sysdev/fsl_rio.c   | 4 ++--
 arch/powerpc/sysdev/fsl_rmu.c   | 1 -
 arch/powerpc/sysdev/fsl_soc.c   | 1 -
 arch/powerpc/sysdev/mpic_msgr.c | 3 ++-
 arch/powerpc/sysdev/mpic_timer.c| 1 -
 arch/powerpc/sysdev/of_rtc.c| 4 ++--
 arch/powerpc/sysdev/pmi.c   | 4 ++--
 70 files changed, 86 insertions(+), 77 deletions(-)

diff --git a/arch/powerpc/include/asm/ibmebus.h 
b/arch/powerpc/include/asm/ibmebus.h
index 088f95b2e14f..6f33253a364a 100644
--- a/arch/powerpc/include/asm/ibmebus.h
+++ b/arch/powerpc/include/asm/ibmebus.h
@@ -46,6 +46,8 @@
 #include 
 #include 
 
+struct platform_driver;
+
 extern struct bus_type ibmebus_bus_ty

[PATCH v2] soc: fsl: Explicitly include correct DT includes

2023-07-24 Thread Rob Herring
The DT of_device.h and of_platform.h date back to the separate
of_platform_bus_type before it as merged into the regular platform bus.
As part of that merge prepping Arm DT support 13 years ago, they
"temporarily" include each other. They also include platform_device.h
and of.h. As a result, there's a pretty much random mix of those include
files used throughout the tree. In order to detangle these headers and
replace the implicit includes with struct declarations, users need to
explicitly include the correct includes.

Signed-off-by: Rob Herring 

---
v2:
 - Add qe.c
---
 drivers/soc/fsl/dpaa2-console.c | 3 ++-
 drivers/soc/fsl/qe/qe.c | 3 ++-
 drivers/soc/fsl/qe/qe_common.c  | 1 -
 drivers/soc/fsl/qe/qe_tdm.c | 4 +---
 4 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/soc/fsl/dpaa2-console.c b/drivers/soc/fsl/dpaa2-console.c
index 53917410f2bd..1dca693b6b38 100644
--- a/drivers/soc/fsl/dpaa2-console.c
+++ b/drivers/soc/fsl/dpaa2-console.c
@@ -9,9 +9,10 @@
 #define pr_fmt(fmt) "dpaa2-console: " fmt
 
 #include 
-#include 
+#include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/drivers/soc/fsl/qe/qe.c b/drivers/soc/fsl/qe/qe.c
index b3c226eb5292..95168b574627 100644
--- a/drivers/soc/fsl/qe/qe.c
+++ b/drivers/soc/fsl/qe/qe.c
@@ -25,7 +25,8 @@
 #include 
 #include 
 #include 
-#include 
+#include 
+#include 
 #include 
 #include 
 
diff --git a/drivers/soc/fsl/qe/qe_common.c b/drivers/soc/fsl/qe/qe_common.c
index a0cb8e746879..9729ce86db59 100644
--- a/drivers/soc/fsl/qe/qe_common.c
+++ b/drivers/soc/fsl/qe/qe_common.c
@@ -16,7 +16,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
diff --git a/drivers/soc/fsl/qe/qe_tdm.c b/drivers/soc/fsl/qe/qe_tdm.c
index 7d7d78d3ee50..a3b691875c8e 100644
--- a/drivers/soc/fsl/qe/qe_tdm.c
+++ b/drivers/soc/fsl/qe/qe_tdm.c
@@ -9,9 +9,7 @@
  */
 #include 
 #include 
-#include 
-#include 
-#include 
+#include 
 #include 
 
 static int set_tdm_framer(const char *tdm_framer_type)
-- 
2.40.1



[PATCH v2] tty: Explicitly include correct DT includes

2023-07-24 Thread Rob Herring
The DT of_device.h and of_platform.h date back to the separate
of_platform_bus_type before it as merged into the regular platform bus.
As part of that merge prepping Arm DT support 13 years ago, they
"temporarily" include each other. They also include platform_device.h
and of.h. As a result, there's a pretty much random mix of those include
files used throughout the tree. In order to detangle these headers and
replace the implicit includes with struct declarations, users need to
explicitly include the correct includes.

Signed-off-by: Rob Herring 
---
v2:
 - Add mpc52xx_uart
---
 drivers/tty/hvc/hvc_opal.c | 2 +-
 drivers/tty/serial/8250/8250_early.c   | 1 -
 drivers/tty/serial/8250/8250_ingenic.c | 1 -
 drivers/tty/serial/8250/8250_omap.c| 1 -
 drivers/tty/serial/amba-pl011.c| 2 +-
 drivers/tty/serial/apbuart.c   | 3 ---
 drivers/tty/serial/atmel_serial.c  | 1 -
 drivers/tty/serial/fsl_linflexuart.c   | 2 +-
 drivers/tty/serial/fsl_lpuart.c| 2 +-
 drivers/tty/serial/imx.c   | 1 -
 drivers/tty/serial/lantiq.c| 3 ++-
 drivers/tty/serial/liteuart.c  | 3 +--
 drivers/tty/serial/ma35d1_serial.c | 2 +-
 drivers/tty/serial/mpc52xx_uart.c  | 2 +-
 drivers/tty/serial/mps2-uart.c | 1 -
 drivers/tty/serial/mxs-auart.c | 2 +-
 drivers/tty/serial/pic32_uart.c| 1 -
 drivers/tty/serial/qcom_geni_serial.c  | 1 -
 drivers/tty/serial/serial-tegra.c  | 1 -
 drivers/tty/serial/sh-sci.c| 1 -
 drivers/tty/serial/sunhv.c | 4 ++--
 drivers/tty/serial/sunsab.c| 3 ++-
 drivers/tty/serial/sunsu.c | 4 ++--
 drivers/tty/serial/sunzilog.c  | 4 ++--
 drivers/tty/serial/tegra-tcu.c | 1 -
 drivers/tty/serial/uartlite.c  | 3 ---
 drivers/tty/serial/ucc_uart.c  | 3 ++-
 drivers/tty/serial/vt8500_serial.c | 2 +-
 28 files changed, 21 insertions(+), 36 deletions(-)

diff --git a/drivers/tty/hvc/hvc_opal.c b/drivers/tty/hvc/hvc_opal.c
index 794c7b18aa06..992e199e0ea8 100644
--- a/drivers/tty/hvc/hvc_opal.c
+++ b/drivers/tty/hvc/hvc_opal.c
@@ -14,7 +14,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 
diff --git a/drivers/tty/serial/8250/8250_early.c 
b/drivers/tty/serial/8250/8250_early.c
index 4299a8bd83d9..9837a27739fd 100644
--- a/drivers/tty/serial/8250/8250_early.c
+++ b/drivers/tty/serial/8250/8250_early.c
@@ -27,7 +27,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
diff --git a/drivers/tty/serial/8250/8250_ingenic.c 
b/drivers/tty/serial/8250/8250_ingenic.c
index 617b8ce60d6b..4c4c4da73ad0 100644
--- a/drivers/tty/serial/8250/8250_ingenic.c
+++ b/drivers/tty/serial/8250/8250_ingenic.c
@@ -13,7 +13,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
diff --git a/drivers/tty/serial/8250/8250_omap.c 
b/drivers/tty/serial/8250/8250_omap.c
index d48a82f1634e..26dd089d8e82 100644
--- a/drivers/tty/serial/8250/8250_omap.c
+++ b/drivers/tty/serial/8250/8250_omap.c
@@ -18,7 +18,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c
index c5c3f4674459..a1e594b79890 100644
--- a/drivers/tty/serial/amba-pl011.c
+++ b/drivers/tty/serial/amba-pl011.c
@@ -20,6 +20,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -36,7 +37,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
diff --git a/drivers/tty/serial/apbuart.c b/drivers/tty/serial/apbuart.c
index 915ee4b0d594..f3defc6da3df 100644
--- a/drivers/tty/serial/apbuart.c
+++ b/drivers/tty/serial/apbuart.c
@@ -22,9 +22,6 @@
 #include 
 #include 
 #include 
-#include 
-#include 
-#include 
 #include 
 #include 
 #include 
diff --git a/drivers/tty/serial/atmel_serial.c 
b/drivers/tty/serial/atmel_serial.c
index 3467a875641a..7ac477344aa3 100644
--- a/drivers/tty/serial/atmel_serial.c
+++ b/drivers/tty/serial/atmel_serial.c
@@ -21,7 +21,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
diff --git a/drivers/tty/serial/fsl_linflexuart.c 
b/drivers/tty/serial/fsl_linflexuart.c
index 6fc21b6684e6..f697751c2ad5 100644
--- a/drivers/tty/serial/fsl_linflexuart.c
+++ b/drivers/tty/serial/fsl_linflexuart.c
@@ -11,7 +11,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c
index 4d80fae20177..e1a8d5415718 100644
--- a/drivers/tty/serial/fsl_lpuart.c
+++ b/drivers/tty/serial/fsl_lpuart.c
@@ -18,9 +18,9 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index 7341d060f85c..3ed5083a7108 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -25,7 +25,6 @@

[PATCH v2] powerpc: Explicitly include correct DT includes

2023-07-18 Thread Rob Herring
The DT of_device.h and of_platform.h date back to the separate
of_platform_bus_type before it as merged into the regular platform bus.
As part of that merge prepping Arm DT support 13 years ago, they
"temporarily" include each other. They also include platform_device.h
and of.h. As a result, there's a pretty much random mix of those include
files used throughout the tree. In order to detangle these headers and
replace the implicit includes with struct declarations, users need to
explicitly include the correct includes.

Signed-off-by: Rob Herring 
---
v2:
- Fix double include of of.h
---
 arch/powerpc/include/asm/ibmebus.h  | 2 ++
 arch/powerpc/include/asm/macio.h| 3 ++-
 arch/powerpc/kernel/legacy_serial.c | 2 +-
 arch/powerpc/kernel/of_platform.c   | 4 +---
 arch/powerpc/kernel/setup-common.c  | 4 ++--
 arch/powerpc/kexec/file_load_64.c   | 2 +-
 arch/powerpc/kexec/ranges.c | 2 +-
 arch/powerpc/platforms/4xx/cpm.c| 2 +-
 arch/powerpc/platforms/4xx/hsta_msi.c   | 2 +-
 arch/powerpc/platforms/4xx/soc.c| 2 +-
 arch/powerpc/platforms/512x/mpc5121_ads.c   | 2 +-
 arch/powerpc/platforms/512x/mpc512x_generic.c   | 2 +-
 arch/powerpc/platforms/512x/mpc512x_lpbfifo.c   | 2 +-
 arch/powerpc/platforms/512x/pdm360ng.c  | 3 ++-
 arch/powerpc/platforms/52xx/mpc52xx_gpt.c   | 3 +--
 arch/powerpc/platforms/82xx/ep8248e.c   | 1 +
 arch/powerpc/platforms/83xx/km83xx.c| 4 ++--
 arch/powerpc/platforms/83xx/suspend.c   | 2 +-
 arch/powerpc/platforms/85xx/bsc913x_qds.c   | 2 +-
 arch/powerpc/platforms/85xx/bsc913x_rdb.c   | 2 +-
 arch/powerpc/platforms/85xx/c293pcie.c  | 3 +--
 arch/powerpc/platforms/85xx/ge_imp3a.c  | 2 +-
 arch/powerpc/platforms/85xx/ksi8560.c   | 3 ++-
 arch/powerpc/platforms/85xx/mpc8536_ds.c| 2 +-
 arch/powerpc/platforms/85xx/mpc85xx_ds.c| 2 +-
 arch/powerpc/platforms/85xx/mpc85xx_mds.c   | 4 ++--
 arch/powerpc/platforms/85xx/mpc85xx_rdb.c   | 3 ++-
 arch/powerpc/platforms/85xx/p1010rdb.c  | 2 +-
 arch/powerpc/platforms/85xx/p1022_ds.c  | 2 +-
 arch/powerpc/platforms/85xx/p1022_rdk.c | 2 +-
 arch/powerpc/platforms/85xx/p1023_rdb.c | 3 +--
 arch/powerpc/platforms/85xx/socrates.c  | 2 +-
 arch/powerpc/platforms/85xx/socrates_fpga_pic.c | 1 -
 arch/powerpc/platforms/85xx/stx_gp3.c   | 2 +-
 arch/powerpc/platforms/85xx/tqm85xx.c   | 2 +-
 arch/powerpc/platforms/85xx/twr_p102x.c | 3 ++-
 arch/powerpc/platforms/85xx/xes_mpc85xx.c   | 2 +-
 arch/powerpc/platforms/86xx/gef_ppc9a.c | 2 +-
 arch/powerpc/platforms/86xx/gef_sbc310.c| 2 +-
 arch/powerpc/platforms/86xx/gef_sbc610.c| 2 +-
 arch/powerpc/platforms/86xx/mvme7100.c  | 1 -
 arch/powerpc/platforms/86xx/pic.c   | 2 +-
 arch/powerpc/platforms/cell/axon_msi.c  | 3 ++-
 arch/powerpc/platforms/cell/cbe_regs.c  | 3 +--
 arch/powerpc/platforms/cell/iommu.c | 2 +-
 arch/powerpc/platforms/cell/setup.c | 1 +
 arch/powerpc/platforms/cell/spider-pci.c| 1 -
 arch/powerpc/platforms/embedded6xx/holly.c  | 2 +-
 arch/powerpc/platforms/maple/setup.c| 4 ++--
 arch/powerpc/platforms/pasemi/gpio_mdio.c   | 2 +-
 arch/powerpc/platforms/pasemi/setup.c   | 2 ++
 arch/powerpc/platforms/powermac/setup.c | 2 +-
 arch/powerpc/platforms/powernv/opal-imc.c   | 1 -
 arch/powerpc/platforms/powernv/opal-rtc.c   | 3 ++-
 arch/powerpc/platforms/powernv/opal-secvar.c| 2 +-
 arch/powerpc/platforms/powernv/opal-sensor.c| 2 ++
 arch/powerpc/platforms/pseries/ibmebus.c| 1 +
 arch/powerpc/sysdev/cpm_common.c| 2 --
 arch/powerpc/sysdev/cpm_gpio.c  | 3 ++-
 arch/powerpc/sysdev/fsl_pmc.c   | 4 ++--
 arch/powerpc/sysdev/fsl_rio.c   | 4 ++--
 arch/powerpc/sysdev/fsl_rmu.c   | 1 -
 arch/powerpc/sysdev/fsl_soc.c   | 1 -
 arch/powerpc/sysdev/mpic_msgr.c | 3 ++-
 arch/powerpc/sysdev/mpic_timer.c| 1 -
 arch/powerpc/sysdev/of_rtc.c| 4 ++--
 arch/powerpc/sysdev/pmi.c   | 4 ++--
 67 files changed, 79 insertions(+), 76 deletions(-)

diff --git a/arch/powerpc/include/asm/ibmebus.h 
b/arch/powerpc/include/asm/ibmebus.h
index 088f95b2e14f..6f33253a364a 100644
--- a/arch/powerpc/include/asm/ibmebus.h
+++ b/arch/powerpc/include/asm/ibmebus.h
@@ -46,6 +46,8 @@
 #include 
 #include 
 
+struct platform_driver;
+
 extern struct bus_type ibmebus_bus_type;
 
 int ibmebus_register_driver(struct platform_driver *drv);
diff --git a/arch/powerpc/include/asm/macio.h b/arch/powerpc/include/asm/macio.h
index ff5fd82d9ff0..3a07c62973aa 100644
--- a/arch/powerpc/include/asm/macio.h
+++ b/arch/powerpc/i

[PATCH v2] dmaengine: Explicitly include correct DT includes

2023-07-18 Thread Rob Herring
The DT of_device.h and of_platform.h date back to the separate
of_platform_bus_type before it as merged into the regular platform bus.
As part of that merge prepping Arm DT support 13 years ago, they
"temporarily" include each other. They also include platform_device.h
and of.h. As a result, there's a pretty much random mix of those include
files used throughout the tree. In order to detangle these headers and
replace the implicit includes with struct declarations, users need to
explicitly include the correct includes.

Signed-off-by: Rob Herring 
---
v2:
- Fix build error on bestcomm
---
 drivers/dma/apple-admac.c  | 3 ++-
 drivers/dma/at_hdmac.c | 2 +-
 drivers/dma/bcm-sba-raid.c | 4 +++-
 drivers/dma/bestcomm/bestcomm.c| 3 +--
 drivers/dma/dma-jz4780.c   | 1 -
 drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c | 1 -
 drivers/dma/dw/rzn1-dmamux.c   | 4 +++-
 drivers/dma/fsl-qdma.c | 4 ++--
 drivers/dma/fsl_raid.c | 3 ++-
 drivers/dma/fsldma.c   | 3 ++-
 drivers/dma/img-mdc-dma.c  | 1 -
 drivers/dma/imx-dma.c  | 2 +-
 drivers/dma/imx-sdma.c | 1 -
 drivers/dma/lpc18xx-dmamux.c   | 4 +++-
 drivers/dma/mediatek/mtk-cqdma.c   | 1 -
 drivers/dma/mediatek/mtk-hsdma.c   | 1 -
 drivers/dma/mediatek/mtk-uart-apdma.c  | 1 -
 drivers/dma/mpc512x_dma.c  | 4 ++--
 drivers/dma/mxs-dma.c  | 1 -
 drivers/dma/nbpfaxi.c  | 1 -
 drivers/dma/owl-dma.c  | 3 ++-
 drivers/dma/ppc4xx/adma.c  | 2 +-
 drivers/dma/qcom/hidma.c   | 2 +-
 drivers/dma/sh/shdmac.c| 1 -
 drivers/dma/sprd-dma.c | 2 +-
 drivers/dma/stm32-dmamux.c | 4 +++-
 drivers/dma/stm32-mdma.c   | 1 -
 drivers/dma/sun6i-dma.c| 2 +-
 drivers/dma/tegra186-gpc-dma.c | 2 +-
 drivers/dma/tegra20-apb-dma.c  | 1 -
 drivers/dma/tegra210-adma.c| 3 ++-
 drivers/dma/ti/dma-crossbar.c  | 5 +++--
 drivers/dma/ti/edma.c  | 1 -
 drivers/dma/ti/k3-udma-private.c   | 2 ++
 drivers/dma/ti/k3-udma.c   | 1 -
 drivers/dma/ti/omap-dma.c  | 2 +-
 drivers/dma/xgene-dma.c| 3 ++-
 drivers/dma/xilinx/xilinx_dma.c| 4 ++--
 drivers/dma/xilinx/zynqmp_dma.c| 3 ++-
 39 files changed, 46 insertions(+), 43 deletions(-)

diff --git a/drivers/dma/apple-admac.c b/drivers/dma/apple-admac.c
index 4cf8da77bdd9..3af795635c5c 100644
--- a/drivers/dma/apple-admac.c
+++ b/drivers/dma/apple-admac.c
@@ -10,8 +10,9 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c
index ee3a219e3a89..b2876f67471f 100644
--- a/drivers/dma/at_hdmac.c
+++ b/drivers/dma/at_hdmac.c
@@ -20,7 +20,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
diff --git a/drivers/dma/bcm-sba-raid.c b/drivers/dma/bcm-sba-raid.c
index 064761289a73..94ea35330eb5 100644
--- a/drivers/dma/bcm-sba-raid.c
+++ b/drivers/dma/bcm-sba-raid.c
@@ -35,7 +35,9 @@
 #include 
 #include 
 #include 
-#include 
+#include 
+#include 
+#include 
 #include 
 #include 
 
diff --git a/drivers/dma/bestcomm/bestcomm.c b/drivers/dma/bestcomm/bestcomm.c
index eabbcfcaa7cb..80096f94032d 100644
--- a/drivers/dma/bestcomm/bestcomm.c
+++ b/drivers/dma/bestcomm/bestcomm.c
@@ -14,9 +14,8 @@
 #include 
 #include 
 #include 
-#include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
diff --git a/drivers/dma/dma-jz4780.c b/drivers/dma/dma-jz4780.c
index 9c1a6e9a9c03..adbd47bd6adf 100644
--- a/drivers/dma/dma-jz4780.c
+++ b/drivers/dma/dma-jz4780.c
@@ -13,7 +13,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
diff --git a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c 
b/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
index 796b6caf0bab..dd02f84e404d 100644
--- a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
+++ b/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
@@ -21,7 +21,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
diff --git a/drivers/dma/dw/rzn1-dmamux.c b/drivers/dma/dw/rzn1-dmamux.c
index f9912c3dd4d7..4fb8508419db 100644
--- a/drivers/dma/dw/rzn1-dmamux.c
+++ b/drivers/dma/dw/rzn1-dmamux.c
@@ -5,8 +5,10 @@
  * Based on TI crossbar driver written by Peter Ujfalusi 

  */
 #include 
-#include 
+#include 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
diff --git a/drive

[PATCH v2] misc: Explicitly include correct DT includes

2023-07-18 Thread Rob Herring
The DT of_device.h and of_platform.h date back to the separate
of_platform_bus_type before it as merged into the regular platform bus.
As part of that merge prepping Arm DT support 13 years ago, they
"temporarily" include each other. They also include platform_device.h
and of.h. As a result, there's a pretty much random mix of those include
files used throughout the tree. In order to detangle these headers and
replace the implicit includes with struct declarations, users need to
explicitly include the correct includes.

Acked-by: Andrew Donnellan  # cxl
Signed-off-by: Rob Herring 
---
v2:
- Fix double include of of.h
---
 drivers/misc/cxl/base.c| 1 +
 drivers/misc/fastrpc.c | 1 +
 drivers/misc/lis3lv02d/lis3lv02d.c | 2 +-
 drivers/misc/qcom-coincell.c   | 1 -
 drivers/misc/sram.c| 2 +-
 drivers/misc/vcpu_stall_detector.c | 1 -
 drivers/misc/xilinx_sdfec.c| 3 ++-
 drivers/misc/xilinx_tmr_inject.c   | 3 ++-
 drivers/misc/xilinx_tmr_manager.c  | 3 ++-
 9 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/drivers/misc/cxl/base.c b/drivers/misc/cxl/base.c
index cc0caf9192dc..b054562c046e 100644
--- a/drivers/misc/cxl/base.c
+++ b/drivers/misc/cxl/base.c
@@ -7,6 +7,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include "cxl.h"
 
diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c
index 9666d28037e1..1c7c0532da6f 100644
--- a/drivers/misc/fastrpc.c
+++ b/drivers/misc/fastrpc.c
@@ -13,6 +13,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/drivers/misc/lis3lv02d/lis3lv02d.c 
b/drivers/misc/lis3lv02d/lis3lv02d.c
index 299d316f1bda..49868a45c0ad 100644
--- a/drivers/misc/lis3lv02d/lis3lv02d.c
+++ b/drivers/misc/lis3lv02d/lis3lv02d.c
@@ -26,7 +26,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include "lis3lv02d.h"
 
 #define DRIVER_NAME "lis3lv02d"
diff --git a/drivers/misc/qcom-coincell.c b/drivers/misc/qcom-coincell.c
index 54d4f6ee..3c57f7429147 100644
--- a/drivers/misc/qcom-coincell.c
+++ b/drivers/misc/qcom-coincell.c
@@ -8,7 +8,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 
 struct qcom_coincell {
diff --git a/drivers/misc/sram.c b/drivers/misc/sram.c
index 5757adf418b1..a88f92cf35be 100644
--- a/drivers/misc/sram.c
+++ b/drivers/misc/sram.c
@@ -10,8 +10,8 @@
 #include 
 #include 
 #include 
+#include 
 #include 
-#include 
 #include 
 #include 
 #include 
diff --git a/drivers/misc/vcpu_stall_detector.c 
b/drivers/misc/vcpu_stall_detector.c
index 53b5506080e1..6479c962da1a 100644
--- a/drivers/misc/vcpu_stall_detector.c
+++ b/drivers/misc/vcpu_stall_detector.c
@@ -13,7 +13,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
diff --git a/drivers/misc/xilinx_sdfec.c b/drivers/misc/xilinx_sdfec.c
index 270ff4c5971a..29e9c380b643 100644
--- a/drivers/misc/xilinx_sdfec.c
+++ b/drivers/misc/xilinx_sdfec.c
@@ -15,7 +15,8 @@
 #include 
 #include 
 #include 
-#include 
+#include 
+#include 
 #include 
 #include 
 #include 
diff --git a/drivers/misc/xilinx_tmr_inject.c b/drivers/misc/xilinx_tmr_inject.c
index d96f6d7cd109..9fc5835bfebc 100644
--- a/drivers/misc/xilinx_tmr_inject.c
+++ b/drivers/misc/xilinx_tmr_inject.c
@@ -11,7 +11,8 @@
 
 #include 
 #include 
-#include 
+#include 
+#include 
 #include 
 
 /* TMR Inject Register offsets */
diff --git a/drivers/misc/xilinx_tmr_manager.c 
b/drivers/misc/xilinx_tmr_manager.c
index 0ef55e06d3a0..3e4e40c3766f 100644
--- a/drivers/misc/xilinx_tmr_manager.c
+++ b/drivers/misc/xilinx_tmr_manager.c
@@ -15,7 +15,8 @@
 
 #include 
 #include 
-#include 
+#include 
+#include 
 
 /* TMR Manager Register offsets */
 #define XTMR_MANAGER_CR_OFFSET 0x0
-- 
2.40.1



[PATCH v2] usb: Explicitly include correct DT includes

2023-07-18 Thread Rob Herring
The DT of_device.h and of_platform.h date back to the separate
of_platform_bus_type before it as merged into the regular platform bus.
As part of that merge prepping Arm DT support 13 years ago, they
"temporarily" include each other. They also include platform_device.h
and of.h. As a result, there's a pretty much random mix of those include
files used throughout the tree. In order to detangle these headers and
replace the implicit includes with struct declarations, users need to
explicitly include the correct includes.

Acked-by: Herve Codina 
Signed-off-by: Rob Herring 
---
v2:
- Fix double include of of.h
---
 drivers/usb/cdns3/cdns3-gadget.c| 1 +
 drivers/usb/cdns3/cdns3-plat.c  | 1 +
 drivers/usb/cdns3/cdns3-ti.c| 1 +
 drivers/usb/cdns3/core.c| 1 +
 drivers/usb/chipidea/ci_hdrc_imx.c  | 1 +
 drivers/usb/chipidea/ci_hdrc_tegra.c| 3 ++-
 drivers/usb/chipidea/usbmisc_imx.c  | 3 ++-
 drivers/usb/common/common.c | 1 +
 drivers/usb/core/message.c  | 1 +
 drivers/usb/core/of.c   | 1 -
 drivers/usb/core/usb.c  | 1 +
 drivers/usb/dwc2/gadget.c   | 1 -
 drivers/usb/dwc2/platform.c | 2 +-
 drivers/usb/dwc3/dwc3-imx8mp.c  | 1 +
 drivers/usb/dwc3/dwc3-keystone.c| 1 +
 drivers/usb/gadget/udc/fsl_udc_core.c   | 1 -
 drivers/usb/gadget/udc/gr_udc.c | 5 ++---
 drivers/usb/gadget/udc/max3420_udc.c| 4 +---
 drivers/usb/gadget/udc/pxa27x_udc.c | 2 +-
 drivers/usb/gadget/udc/renesas_usb3.c   | 2 +-
 drivers/usb/gadget/udc/renesas_usbf.c   | 5 ++---
 drivers/usb/gadget/udc/tegra-xudc.c | 1 -
 drivers/usb/gadget/udc/udc-xilinx.c | 6 ++
 drivers/usb/host/ehci-fsl.c | 2 +-
 drivers/usb/host/ehci-orion.c   | 2 --
 drivers/usb/host/fhci-hcd.c | 3 ++-
 drivers/usb/host/fsl-mph-dr-of.c| 3 ++-
 drivers/usb/host/ohci-at91.c| 2 +-
 drivers/usb/host/ohci-da8xx.c   | 1 +
 drivers/usb/host/ohci-ppc-of.c  | 3 ++-
 drivers/usb/host/xhci-plat.c| 1 -
 drivers/usb/host/xhci-rcar.c| 1 -
 drivers/usb/host/xhci-tegra.c   | 2 +-
 drivers/usb/misc/usb251xb.c | 2 +-
 drivers/usb/mtu3/mtu3.h | 1 +
 drivers/usb/mtu3/mtu3_host.c| 1 +
 drivers/usb/musb/jz4740.c   | 2 +-
 drivers/usb/musb/mediatek.c | 1 +
 drivers/usb/musb/mpfs.c | 1 +
 drivers/usb/musb/musb_dsps.c| 2 --
 drivers/usb/musb/sunxi.c| 1 -
 drivers/usb/phy/phy-mxs-usb.c   | 2 +-
 drivers/usb/phy/phy-tegra-usb.c | 2 +-
 drivers/usb/renesas_usbhs/common.c  | 2 +-
 drivers/usb/renesas_usbhs/rza.c | 2 +-
 drivers/usb/renesas_usbhs/rza2.c| 1 -
 drivers/usb/typec/tcpm/fusb302.c| 2 +-
 drivers/usb/typec/tcpm/qcom/qcom_pmic_typec.c   | 2 +-
 drivers/usb/typec/tcpm/qcom/qcom_pmic_typec_pdphy.c | 2 --
 drivers/usb/typec/tcpm/qcom/qcom_pmic_typec_port.c  | 1 -
 drivers/usb/typec/ucsi/ucsi_glink.c | 1 -
 51 files changed, 46 insertions(+), 48 deletions(-)

diff --git a/drivers/usb/cdns3/cdns3-gadget.c b/drivers/usb/cdns3/cdns3-gadget.c
index ea19253fd2d0..e6f6aeb7b5bb 100644
--- a/drivers/usb/cdns3/cdns3-gadget.c
+++ b/drivers/usb/cdns3/cdns3-gadget.c
@@ -61,6 +61,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "core.h"
 #include "gadget-export.h"
diff --git a/drivers/usb/cdns3/cdns3-plat.c b/drivers/usb/cdns3/cdns3-plat.c
index 884e2301237f..b15ff5bd91c2 100644
--- a/drivers/usb/cdns3/cdns3-plat.c
+++ b/drivers/usb/cdns3/cdns3-plat.c
@@ -15,6 +15,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
diff --git a/drivers/usb/cdns3/cdns3-ti.c b/drivers/usb/cdns3/cdns3-ti.c
index 81b9132e3aaa..5945c4b1e11f 100644
--- a/drivers/usb/cdns3/cdns3-ti.c
+++ b/drivers/usb/cdns3/cdns3-ti.c
@@ -15,6 +15,7 @@
 #include 
 #include 
 #include 
+#include 
 
 /* USB Wrapper register offsets */
 #define USBSS_PID  0x0
diff --git a/drivers/usb/cdns3/core.c b/drivers/usb/cdns3/core.c
index dbcdf3b24b47..baa154cee352 100644
--- a/drivers/usb/cdns3/core.c
+++ b/drivers/usb/cdns3/core.c
@@ -14,6 +14,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/drivers/usb/chipidea/ci_hdrc_imx.c 
b/drivers/usb/chipidea/ci

Re: [PATCH] misc: Explicitly include correct DT includes

2023-07-17 Thread Rob Herring
On Fri, Jul 14, 2023 at 11:47 AM Rob Herring  wrote:
>
> The DT of_device.h and of_platform.h date back to the separate
> of_platform_bus_type before it as merged into the regular platform bus.
> As part of that merge prepping Arm DT support 13 years ago, they
> "temporarily" include each other. They also include platform_device.h
> and of.h. As a result, there's a pretty much random mix of those include
> files used throughout the tree. In order to detangle these headers and
> replace the implicit includes with struct declarations, users need to
> explicitly include the correct includes.
>
> Signed-off-by: Rob Herring 
> ---
>  drivers/misc/cxl/base.c| 1 +
>  drivers/misc/fastrpc.c | 1 +
>  drivers/misc/lis3lv02d/lis3lv02d.c | 2 +-
>  drivers/misc/qcom-coincell.c   | 1 -
>  drivers/misc/sram.c| 2 +-
>  drivers/misc/vcpu_stall_detector.c | 1 -
>  drivers/misc/xilinx_sdfec.c| 4 +++-
>  drivers/misc/xilinx_tmr_inject.c   | 3 ++-
>  drivers/misc/xilinx_tmr_manager.c  | 3 ++-
>  9 files changed, 11 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/misc/cxl/base.c b/drivers/misc/cxl/base.c
> index cc0caf9192dc..b054562c046e 100644
> --- a/drivers/misc/cxl/base.c
> +++ b/drivers/misc/cxl/base.c
> @@ -7,6 +7,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
>  #include "cxl.h"
>
> diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c
> index 9666d28037e1..1c7c0532da6f 100644
> --- a/drivers/misc/fastrpc.c
> +++ b/drivers/misc/fastrpc.c
> @@ -13,6 +13,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
>  #include 
>  #include 
> diff --git a/drivers/misc/lis3lv02d/lis3lv02d.c 
> b/drivers/misc/lis3lv02d/lis3lv02d.c
> index 299d316f1bda..49868a45c0ad 100644
> --- a/drivers/misc/lis3lv02d/lis3lv02d.c
> +++ b/drivers/misc/lis3lv02d/lis3lv02d.c
> @@ -26,7 +26,7 @@
>  #include 
>  #include 
>  #include 
> -#include 
> +#include 
>  #include "lis3lv02d.h"
>
>  #define DRIVER_NAME "lis3lv02d"
> diff --git a/drivers/misc/qcom-coincell.c b/drivers/misc/qcom-coincell.c
> index 54d4f6ee..3c57f7429147 100644
> --- a/drivers/misc/qcom-coincell.c
> +++ b/drivers/misc/qcom-coincell.c
> @@ -8,7 +8,6 @@
>  #include 
>  #include 
>  #include 
> -#include 
>  #include 
>
>  struct qcom_coincell {
> diff --git a/drivers/misc/sram.c b/drivers/misc/sram.c
> index 5757adf418b1..a88f92cf35be 100644
> --- a/drivers/misc/sram.c
> +++ b/drivers/misc/sram.c
> @@ -10,8 +10,8 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
> -#include 
>  #include 
>  #include 
>  #include 
> diff --git a/drivers/misc/vcpu_stall_detector.c 
> b/drivers/misc/vcpu_stall_detector.c
> index 53b5506080e1..6479c962da1a 100644
> --- a/drivers/misc/vcpu_stall_detector.c
> +++ b/drivers/misc/vcpu_stall_detector.c
> @@ -13,7 +13,6 @@
>  #include 
>  #include 
>  #include 
> -#include 
>  #include 
>  #include 
>  #include 
> diff --git a/drivers/misc/xilinx_sdfec.c b/drivers/misc/xilinx_sdfec.c
> index 270ff4c5971a..35941c006552 100644
> --- a/drivers/misc/xilinx_sdfec.c
> +++ b/drivers/misc/xilinx_sdfec.c
> @@ -15,12 +15,14 @@
>  #include 
>  #include 
>  #include 
> -#include 
> +#include 
> +#include 
>  #include 
>  #include 
>  #include 
>  #include 
>  #include 
> +#include 

Double include of of.h. v2 coming.


Re: [PATCH] usb: Explicitly include correct DT includes

2023-07-17 Thread Rob Herring
On Fri, Jul 14, 2023 at 11:50 AM Rob Herring  wrote:
>
> The DT of_device.h and of_platform.h date back to the separate
> of_platform_bus_type before it as merged into the regular platform bus.
> As part of that merge prepping Arm DT support 13 years ago, they
> "temporarily" include each other. They also include platform_device.h
> and of.h. As a result, there's a pretty much random mix of those include
> files used throughout the tree. In order to detangle these headers and
> replace the implicit includes with struct declarations, users need to
> explicitly include the correct includes.
>
> Signed-off-by: Rob Herring 
> ---

[...]

> diff --git a/drivers/usb/host/fsl-mph-dr-of.c 
> b/drivers/usb/host/fsl-mph-dr-of.c
> index a9877f2569f4..2574bccc151b 100644
> --- a/drivers/usb/host/fsl-mph-dr-of.c
> +++ b/drivers/usb/host/fsl-mph-dr-of.c
> @@ -10,10 +10,12 @@
>  #include 
>  #include 
>  #include 
> -#include 
> +#include 
> +#include 
>  #include 
>  #include 
>  #include 
> +#include 

Double include of of.h here. v2 coming.

Rob


Re: [PATCH] dmaengine: Explicitly include correct DT includes

2023-07-17 Thread Rob Herring
On Fri, Jul 14, 2023 at 11:44 AM Rob Herring  wrote:
>
> The DT of_device.h and of_platform.h date back to the separate
> of_platform_bus_type before it as merged into the regular platform bus.
> As part of that merge prepping Arm DT support 13 years ago, they
> "temporarily" include each other. They also include platform_device.h
> and of.h. As a result, there's a pretty much random mix of those include
> files used throughout the tree. In order to detangle these headers and
> replace the implicit includes with struct declarations, users need to
> explicitly include the correct includes.
>
> Signed-off-by: Rob Herring 
> ---
>  drivers/dma/apple-admac.c  | 3 ++-
>  drivers/dma/at_hdmac.c | 2 +-
>  drivers/dma/bcm-sba-raid.c | 4 +++-
>  drivers/dma/bestcomm/bestcomm.c| 4 +---

v2 coming for this:

>> drivers/dma/bestcomm/bestcomm.
c:80:13: error: call to undeclared function 'irq_of_parse_and_map';
ISO C99 and later do not support implicit function declarations
[-Wimplicit-function-declaration]
  80 | tsk->irq = irq_of_parse_and_map(bcom_eng->ofnode,
tsk->tasknum);
 |^
>> drivers/dma/bestcomm/bestcomm.c:105:4: error: call to undeclared function 
>> 'irq_dispose_mapping'; ISO C99 and later do not support implicit function 
>> declarations [-Wimplicit-function-declaration]
 105 | irq_dispose_mapping(tsk->irq);
 | ^
   drivers/dma/bestcomm/bestcomm.c:128:2: error: call to undeclared
function 'irq_dispose_mapping'; ISO C99 and later do not support
implicit function declarations [-Wimplicit-function-declaration]
 128 | irq_dispose_mapping(tsk->irq);
 | ^
   3 errors generated.


Re: [PATCH 2/2] PCI: layerscape: Add the workaround for lost link capablities during reset

2023-07-17 Thread Rob Herring
On Thu, Jun 15, 2023 at 10:41 AM Frank Li  wrote:
>
> From: Xiaowei Bao 
>
> A workaround for the issue where the PCI Express Endpoint (EP) controller
> loses the values of the Maximum Link Width and Supported Link Speed from
> the Link Capabilities Register, which initially configured by the Reset
> Configuration Word (RCW) during a link-down or hot reset event.

What makes this Layerscape specific? Seems like something internal to DWC.

>
> Signed-off-by: Xiaowei Bao 
> Signed-off-by: Hou Zhiqiang 
> Signed-off-by: Frank Li 
> ---
>  drivers/pci/controller/dwc/pci-layerscape-ep.c | 13 +
>  1 file changed, 13 insertions(+)
>
> diff --git a/drivers/pci/controller/dwc/pci-layerscape-ep.c 
> b/drivers/pci/controller/dwc/pci-layerscape-ep.c
> index 4e4fdd1dfea7..2ef02d827eeb 100644
> --- a/drivers/pci/controller/dwc/pci-layerscape-ep.c
> +++ b/drivers/pci/controller/dwc/pci-layerscape-ep.c
> @@ -45,6 +45,7 @@ struct ls_pcie_ep {
> struct pci_epc_features *ls_epc;
> const struct ls_pcie_ep_drvdata *drvdata;
> int irq;
> +   u32 lnkcap;
> boolbig_endian;
>  };
>
> @@ -73,6 +74,7 @@ static irqreturn_t ls_pcie_ep_event_handler(int irq, void 
> *dev_id)
> struct ls_pcie_ep *pcie = dev_id;
> struct dw_pcie *pci = pcie->pci;
> u32 val, cfg;
> +   u8 offset;
>
> val = ls_lut_readl(pcie, PEX_PF0_PME_MES_DR);
> ls_lut_writel(pcie, PEX_PF0_PME_MES_DR, val);
> @@ -81,6 +83,13 @@ static irqreturn_t ls_pcie_ep_event_handler(int irq, void 
> *dev_id)
> return IRQ_NONE;
>
> if (val & PEX_PF0_PME_MES_DR_LUD) {
> +
> +   offset = dw_pcie_find_capability(pci, PCI_CAP_ID_EXP);
> +
> +   dw_pcie_dbi_ro_wr_en(pci);
> +   dw_pcie_writew_dbi(pci, offset + PCI_EXP_LNKCAP, 
> pcie->lnkcap);
> +   dw_pcie_dbi_ro_wr_dis(pci);
> +
> cfg = ls_lut_readl(pcie, PEX_PF0_CONFIG);
> cfg |= PEX_PF0_CFG_READY;
> ls_lut_writel(pcie, PEX_PF0_CONFIG, cfg);
> @@ -216,6 +225,7 @@ static int __init ls_pcie_ep_probe(struct platform_device 
> *pdev)
> struct ls_pcie_ep *pcie;
> struct pci_epc_features *ls_epc;
> struct resource *dbi_base;
> +   u8 offset;
> int ret;
>
> pcie = devm_kzalloc(dev, sizeof(*pcie), GFP_KERNEL);
> @@ -252,6 +262,9 @@ static int __init ls_pcie_ep_probe(struct platform_device 
> *pdev)
>
> platform_set_drvdata(pdev, pcie);
>
> +   offset = dw_pcie_find_capability(pci, PCI_CAP_ID_EXP);
> +   pcie->lnkcap = dw_pcie_readl_dbi(pci, offset + PCI_EXP_LNKCAP);
> +
> ret = dw_pcie_ep_init(>ep);
> if (ret)
> return ret;
> --
> 2.34.1
>


[PATCH] I2C: Explicitly include correct DT includes

2023-07-14 Thread Rob Herring
The DT of_device.h and of_platform.h date back to the separate
of_platform_bus_type before it as merged into the regular platform bus.
As part of that merge prepping Arm DT support 13 years ago, they
"temporarily" include each other. They also include platform_device.h
and of.h. As a result, there's a pretty much random mix of those include
files used throughout the tree. In order to detangle these headers and
replace the implicit includes with struct declarations, users need to
explicitly include the correct includes.

Signed-off-by: Rob Herring 
---
 drivers/i2c/busses/i2c-at91-core.c| 1 -
 drivers/i2c/busses/i2c-at91-master.c  | 1 -
 drivers/i2c/busses/i2c-bcm-iproc.c| 2 +-
 drivers/i2c/busses/i2c-bcm2835.c  | 2 +-
 drivers/i2c/busses/i2c-cpm.c  | 4 ++--
 drivers/i2c/busses/i2c-davinci.c  | 2 +-
 drivers/i2c/busses/i2c-emev2.c| 2 +-
 drivers/i2c/busses/i2c-exynos5.c  | 4 +---
 drivers/i2c/busses/i2c-gxp.c  | 3 ++-
 drivers/i2c/busses/i2c-ibm_iic.c  | 3 ++-
 drivers/i2c/busses/i2c-imx-lpi2c.c| 1 -
 drivers/i2c/busses/i2c-imx.c  | 1 -
 drivers/i2c/busses/i2c-jz4780.c   | 2 +-
 drivers/i2c/busses/i2c-lpc2k.c| 1 -
 drivers/i2c/busses/i2c-meson.c| 1 -
 drivers/i2c/busses/i2c-mlxbf.c| 2 +-
 drivers/i2c/busses/i2c-mpc.c  | 3 ++-
 drivers/i2c/busses/i2c-mt65xx.c   | 4 +---
 drivers/i2c/busses/i2c-mt7621.c   | 3 ++-
 drivers/i2c/busses/i2c-mxs.c  | 1 -
 drivers/i2c/busses/i2c-npcm7xx.c  | 1 -
 drivers/i2c/busses/i2c-owl.c  | 3 ++-
 drivers/i2c/busses/i2c-pca-platform.c | 1 -
 drivers/i2c/busses/i2c-pxa-pci.c  | 1 -
 drivers/i2c/busses/i2c-rcar.c | 2 +-
 drivers/i2c/busses/i2c-riic.c | 1 -
 drivers/i2c/busses/i2c-s3c2410.c  | 1 -
 drivers/i2c/busses/i2c-sh_mobile.c| 2 +-
 drivers/i2c/busses/i2c-sprd.c | 1 -
 drivers/i2c/busses/i2c-tegra-bpmp.c   | 2 +-
 drivers/i2c/busses/i2c-tegra.c| 2 +-
 drivers/i2c/muxes/i2c-mux-gpmux.c | 2 +-
 drivers/i2c/muxes/i2c-mux-ltc4306.c   | 1 -
 33 files changed, 25 insertions(+), 38 deletions(-)

diff --git a/drivers/i2c/busses/i2c-at91-core.c 
b/drivers/i2c/busses/i2c-at91-core.c
index 05ad3bc3578a..3563a7fd75db 100644
--- a/drivers/i2c/busses/i2c-at91-core.c
+++ b/drivers/i2c/busses/i2c-at91-core.c
@@ -19,7 +19,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
diff --git a/drivers/i2c/busses/i2c-at91-master.c 
b/drivers/i2c/busses/i2c-at91-master.c
index c0c35785a0dc..94cff1cd527e 100644
--- a/drivers/i2c/busses/i2c-at91-master.c
+++ b/drivers/i2c/busses/i2c-at91-master.c
@@ -23,7 +23,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
diff --git a/drivers/i2c/busses/i2c-bcm-iproc.c 
b/drivers/i2c/busses/i2c-bcm-iproc.c
index 2d8342fdc25d..37d559bc51c4 100644
--- a/drivers/i2c/busses/i2c-bcm-iproc.c
+++ b/drivers/i2c/busses/i2c-bcm-iproc.c
@@ -7,7 +7,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 
diff --git a/drivers/i2c/busses/i2c-bcm2835.c b/drivers/i2c/busses/i2c-bcm2835.c
index 8ce6d3f49551..2743e59184b3 100644
--- a/drivers/i2c/busses/i2c-bcm2835.c
+++ b/drivers/i2c/busses/i2c-bcm2835.c
@@ -12,7 +12,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 
diff --git a/drivers/i2c/busses/i2c-cpm.c b/drivers/i2c/busses/i2c-cpm.c
index 732daf6a932b..9a664abf734d 100644
--- a/drivers/i2c/busses/i2c-cpm.c
+++ b/drivers/i2c/busses/i2c-cpm.c
@@ -26,10 +26,10 @@
 #include 
 #include 
 #include 
+#include 
 #include 
-#include 
 #include 
-#include 
+#include 
 #include 
 #include 
 
diff --git a/drivers/i2c/busses/i2c-davinci.c b/drivers/i2c/busses/i2c-davinci.c
index 71b60778c643..927ea9ba74ab 100644
--- a/drivers/i2c/busses/i2c-davinci.c
+++ b/drivers/i2c/busses/i2c-davinci.c
@@ -25,7 +25,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 
diff --git a/drivers/i2c/busses/i2c-emev2.c b/drivers/i2c/busses/i2c-emev2.c
index 4ba93cd91c0f..557409410445 100644
--- a/drivers/i2c/busses/i2c-emev2.c
+++ b/drivers/i2c/busses/i2c-emev2.c
@@ -16,7 +16,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 
diff --git a/drivers/i2c/busses/i2c-exynos5.c b/drivers/i2c/busses/i2c-exynos5.c
index f378cd479e55..7668210a59d5 100644
--- a/drivers/i2c/busses/i2c-exynos5.c
+++ b/drivers/i2c/busses/i2c-exynos5.c
@@ -18,9 +18,7 @@
 #include 
 #include 
 #include 
-#include 
-#include 
-#include 
+#include 
 #include 
 
 /*
diff --git a/drivers/i2c/busses/i2c-gxp.c b/drivers/i2c/busses/i2c-gxp.c
index 70b0de07ed99..efafc0528c44 100644
--- a/drivers/i2c/busses/i2c-gxp.c
+++ b/drivers/i2c/busses/i2c-gxp.c
@@ -4,8 +4,9 @@
 #include 
 #include 
 #include 
+#include 
 #include 
-#include 
+#include 
 #include 
 #include 
 
diff --git a/drivers/i2c/busses/i2c-ibm_iic.c b/drivers/i2c/busses/i2c-ibm_iic.c
index 1ad9d3b26dd3..408820319ec4 100644
---

Re: [PATCH 1/2] ASoC: dt-bindings: fsl_rpmsg: Add compatible string for i.MX93

2023-07-14 Thread Rob Herring


On Fri, 14 Jul 2023 17:29:12 +0800, Chancel Liu wrote:
> Add compatible string for i.MX93 platform which supports audio
> function through rpmsg channel between Cortex-A and Cortex-M core.
> 
> Signed-off-by: Chancel Liu 
> ---
>  Documentation/devicetree/bindings/sound/fsl,rpmsg.yaml | 1 +
>  1 file changed, 1 insertion(+)
> 

Acked-by: Rob Herring 



[PATCH] soc: fsl: Explicitly include correct DT includes

2023-07-14 Thread Rob Herring
The DT of_device.h and of_platform.h date back to the separate
of_platform_bus_type before it as merged into the regular platform bus.
As part of that merge prepping Arm DT support 13 years ago, they
"temporarily" include each other. They also include platform_device.h
and of.h. As a result, there's a pretty much random mix of those include
files used throughout the tree. In order to detangle these headers and
replace the implicit includes with struct declarations, users need to
explicitly include the correct includes.

Signed-off-by: Rob Herring 
---
 drivers/soc/fsl/dpaa2-console.c | 3 ++-
 drivers/soc/fsl/qe/qe_common.c  | 1 -
 drivers/soc/fsl/qe/qe_tdm.c | 4 +---
 3 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/soc/fsl/dpaa2-console.c b/drivers/soc/fsl/dpaa2-console.c
index 53917410f2bd..1dca693b6b38 100644
--- a/drivers/soc/fsl/dpaa2-console.c
+++ b/drivers/soc/fsl/dpaa2-console.c
@@ -9,9 +9,10 @@
 #define pr_fmt(fmt) "dpaa2-console: " fmt
 
 #include 
-#include 
+#include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/drivers/soc/fsl/qe/qe_common.c b/drivers/soc/fsl/qe/qe_common.c
index a0cb8e746879..9729ce86db59 100644
--- a/drivers/soc/fsl/qe/qe_common.c
+++ b/drivers/soc/fsl/qe/qe_common.c
@@ -16,7 +16,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
diff --git a/drivers/soc/fsl/qe/qe_tdm.c b/drivers/soc/fsl/qe/qe_tdm.c
index 7d7d78d3ee50..a3b691875c8e 100644
--- a/drivers/soc/fsl/qe/qe_tdm.c
+++ b/drivers/soc/fsl/qe/qe_tdm.c
@@ -9,9 +9,7 @@
  */
 #include 
 #include 
-#include 
-#include 
-#include 
+#include 
 #include 
 
 static int set_tdm_framer(const char *tdm_framer_type)
-- 
2.40.1



[PATCH] usb: Explicitly include correct DT includes

2023-07-14 Thread Rob Herring
The DT of_device.h and of_platform.h date back to the separate
of_platform_bus_type before it as merged into the regular platform bus.
As part of that merge prepping Arm DT support 13 years ago, they
"temporarily" include each other. They also include platform_device.h
and of.h. As a result, there's a pretty much random mix of those include
files used throughout the tree. In order to detangle these headers and
replace the implicit includes with struct declarations, users need to
explicitly include the correct includes.

Signed-off-by: Rob Herring 
---
 drivers/usb/cdns3/cdns3-gadget.c| 1 +
 drivers/usb/cdns3/cdns3-plat.c  | 1 +
 drivers/usb/cdns3/cdns3-ti.c| 1 +
 drivers/usb/cdns3/core.c| 1 +
 drivers/usb/chipidea/ci_hdrc_imx.c  | 1 +
 drivers/usb/chipidea/ci_hdrc_tegra.c| 3 ++-
 drivers/usb/chipidea/usbmisc_imx.c  | 3 ++-
 drivers/usb/common/common.c | 1 +
 drivers/usb/core/message.c  | 1 +
 drivers/usb/core/of.c   | 1 -
 drivers/usb/core/usb.c  | 1 +
 drivers/usb/dwc2/gadget.c   | 1 -
 drivers/usb/dwc2/platform.c | 2 +-
 drivers/usb/dwc3/dwc3-imx8mp.c  | 1 +
 drivers/usb/dwc3/dwc3-keystone.c| 1 +
 drivers/usb/gadget/udc/fsl_udc_core.c   | 1 -
 drivers/usb/gadget/udc/gr_udc.c | 5 ++---
 drivers/usb/gadget/udc/max3420_udc.c| 4 +---
 drivers/usb/gadget/udc/pxa27x_udc.c | 2 +-
 drivers/usb/gadget/udc/renesas_usb3.c   | 2 +-
 drivers/usb/gadget/udc/renesas_usbf.c   | 5 ++---
 drivers/usb/gadget/udc/tegra-xudc.c | 1 -
 drivers/usb/gadget/udc/udc-xilinx.c | 6 ++
 drivers/usb/host/ehci-fsl.c | 2 +-
 drivers/usb/host/ehci-orion.c   | 2 --
 drivers/usb/host/fhci-hcd.c | 3 ++-
 drivers/usb/host/fsl-mph-dr-of.c| 4 +++-
 drivers/usb/host/ohci-at91.c| 2 +-
 drivers/usb/host/ohci-da8xx.c   | 1 +
 drivers/usb/host/ohci-ppc-of.c  | 3 ++-
 drivers/usb/host/xhci-plat.c| 1 -
 drivers/usb/host/xhci-rcar.c| 1 -
 drivers/usb/host/xhci-tegra.c   | 2 +-
 drivers/usb/misc/usb251xb.c | 2 +-
 drivers/usb/mtu3/mtu3.h | 1 +
 drivers/usb/mtu3/mtu3_host.c| 1 +
 drivers/usb/musb/jz4740.c   | 2 +-
 drivers/usb/musb/mediatek.c | 1 +
 drivers/usb/musb/mpfs.c | 1 +
 drivers/usb/musb/musb_dsps.c| 2 --
 drivers/usb/musb/sunxi.c| 1 -
 drivers/usb/phy/phy-mxs-usb.c   | 2 +-
 drivers/usb/phy/phy-tegra-usb.c | 2 +-
 drivers/usb/renesas_usbhs/common.c  | 2 +-
 drivers/usb/renesas_usbhs/rza.c | 2 +-
 drivers/usb/renesas_usbhs/rza2.c| 1 -
 drivers/usb/typec/tcpm/fusb302.c| 2 +-
 drivers/usb/typec/tcpm/qcom/qcom_pmic_typec.c   | 2 +-
 drivers/usb/typec/tcpm/qcom/qcom_pmic_typec_pdphy.c | 2 --
 drivers/usb/typec/tcpm/qcom/qcom_pmic_typec_port.c  | 1 -
 drivers/usb/typec/ucsi/ucsi_glink.c | 1 -
 51 files changed, 47 insertions(+), 48 deletions(-)

diff --git a/drivers/usb/cdns3/cdns3-gadget.c b/drivers/usb/cdns3/cdns3-gadget.c
index ea19253fd2d0..e6f6aeb7b5bb 100644
--- a/drivers/usb/cdns3/cdns3-gadget.c
+++ b/drivers/usb/cdns3/cdns3-gadget.c
@@ -61,6 +61,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "core.h"
 #include "gadget-export.h"
diff --git a/drivers/usb/cdns3/cdns3-plat.c b/drivers/usb/cdns3/cdns3-plat.c
index 884e2301237f..b15ff5bd91c2 100644
--- a/drivers/usb/cdns3/cdns3-plat.c
+++ b/drivers/usb/cdns3/cdns3-plat.c
@@ -15,6 +15,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
diff --git a/drivers/usb/cdns3/cdns3-ti.c b/drivers/usb/cdns3/cdns3-ti.c
index 81b9132e3aaa..5945c4b1e11f 100644
--- a/drivers/usb/cdns3/cdns3-ti.c
+++ b/drivers/usb/cdns3/cdns3-ti.c
@@ -15,6 +15,7 @@
 #include 
 #include 
 #include 
+#include 
 
 /* USB Wrapper register offsets */
 #define USBSS_PID  0x0
diff --git a/drivers/usb/cdns3/core.c b/drivers/usb/cdns3/core.c
index dbcdf3b24b47..baa154cee352 100644
--- a/drivers/usb/cdns3/core.c
+++ b/drivers/usb/cdns3/core.c
@@ -14,6 +14,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/drivers/usb/chipidea/ci_hdrc_imx.c 
b/drivers/usb/chipidea/ci_hdrc_imx.c
index 336ef6dd8e7d..aa2aebed8e2d 100

[PATCH] tty: Explicitly include correct DT includes

2023-07-14 Thread Rob Herring
The DT of_device.h and of_platform.h date back to the separate
of_platform_bus_type before it as merged into the regular platform bus.
As part of that merge prepping Arm DT support 13 years ago, they
"temporarily" include each other. They also include platform_device.h
and of.h. As a result, there's a pretty much random mix of those include
files used throughout the tree. In order to detangle these headers and
replace the implicit includes with struct declarations, users need to
explicitly include the correct includes.

Signed-off-by: Rob Herring 
---
 drivers/tty/hvc/hvc_opal.c | 2 +-
 drivers/tty/serial/8250/8250_early.c   | 1 -
 drivers/tty/serial/8250/8250_ingenic.c | 1 -
 drivers/tty/serial/8250/8250_omap.c| 1 -
 drivers/tty/serial/amba-pl011.c| 2 +-
 drivers/tty/serial/apbuart.c   | 3 ---
 drivers/tty/serial/atmel_serial.c  | 1 -
 drivers/tty/serial/fsl_linflexuart.c   | 2 +-
 drivers/tty/serial/fsl_lpuart.c| 2 +-
 drivers/tty/serial/imx.c   | 1 -
 drivers/tty/serial/lantiq.c| 3 ++-
 drivers/tty/serial/liteuart.c  | 3 +--
 drivers/tty/serial/ma35d1_serial.c | 2 +-
 drivers/tty/serial/mps2-uart.c | 1 -
 drivers/tty/serial/mxs-auart.c | 2 +-
 drivers/tty/serial/pic32_uart.c| 1 -
 drivers/tty/serial/qcom_geni_serial.c  | 1 -
 drivers/tty/serial/serial-tegra.c  | 1 -
 drivers/tty/serial/sh-sci.c| 1 -
 drivers/tty/serial/sunhv.c | 4 ++--
 drivers/tty/serial/sunsab.c| 3 ++-
 drivers/tty/serial/sunsu.c | 4 ++--
 drivers/tty/serial/sunzilog.c  | 4 ++--
 drivers/tty/serial/tegra-tcu.c | 1 -
 drivers/tty/serial/uartlite.c  | 3 ---
 drivers/tty/serial/ucc_uart.c  | 3 ++-
 drivers/tty/serial/vt8500_serial.c | 2 +-
 27 files changed, 20 insertions(+), 35 deletions(-)

diff --git a/drivers/tty/hvc/hvc_opal.c b/drivers/tty/hvc/hvc_opal.c
index 794c7b18aa06..992e199e0ea8 100644
--- a/drivers/tty/hvc/hvc_opal.c
+++ b/drivers/tty/hvc/hvc_opal.c
@@ -14,7 +14,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 
diff --git a/drivers/tty/serial/8250/8250_early.c 
b/drivers/tty/serial/8250/8250_early.c
index 4299a8bd83d9..9837a27739fd 100644
--- a/drivers/tty/serial/8250/8250_early.c
+++ b/drivers/tty/serial/8250/8250_early.c
@@ -27,7 +27,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
diff --git a/drivers/tty/serial/8250/8250_ingenic.c 
b/drivers/tty/serial/8250/8250_ingenic.c
index 617b8ce60d6b..4c4c4da73ad0 100644
--- a/drivers/tty/serial/8250/8250_ingenic.c
+++ b/drivers/tty/serial/8250/8250_ingenic.c
@@ -13,7 +13,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
diff --git a/drivers/tty/serial/8250/8250_omap.c 
b/drivers/tty/serial/8250/8250_omap.c
index d48a82f1634e..26dd089d8e82 100644
--- a/drivers/tty/serial/8250/8250_omap.c
+++ b/drivers/tty/serial/8250/8250_omap.c
@@ -18,7 +18,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c
index c5c3f4674459..a1e594b79890 100644
--- a/drivers/tty/serial/amba-pl011.c
+++ b/drivers/tty/serial/amba-pl011.c
@@ -20,6 +20,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -36,7 +37,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
diff --git a/drivers/tty/serial/apbuart.c b/drivers/tty/serial/apbuart.c
index 915ee4b0d594..f3defc6da3df 100644
--- a/drivers/tty/serial/apbuart.c
+++ b/drivers/tty/serial/apbuart.c
@@ -22,9 +22,6 @@
 #include 
 #include 
 #include 
-#include 
-#include 
-#include 
 #include 
 #include 
 #include 
diff --git a/drivers/tty/serial/atmel_serial.c 
b/drivers/tty/serial/atmel_serial.c
index 3467a875641a..7ac477344aa3 100644
--- a/drivers/tty/serial/atmel_serial.c
+++ b/drivers/tty/serial/atmel_serial.c
@@ -21,7 +21,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
diff --git a/drivers/tty/serial/fsl_linflexuart.c 
b/drivers/tty/serial/fsl_linflexuart.c
index 6fc21b6684e6..f697751c2ad5 100644
--- a/drivers/tty/serial/fsl_linflexuart.c
+++ b/drivers/tty/serial/fsl_linflexuart.c
@@ -11,7 +11,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c
index 4d80fae20177..e1a8d5415718 100644
--- a/drivers/tty/serial/fsl_lpuart.c
+++ b/drivers/tty/serial/fsl_lpuart.c
@@ -18,9 +18,9 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index 7341d060f85c..3ed5083a7108 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -25,7 +25,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 
diff --git a/d

[PATCH] misc: Explicitly include correct DT includes

2023-07-14 Thread Rob Herring
The DT of_device.h and of_platform.h date back to the separate
of_platform_bus_type before it as merged into the regular platform bus.
As part of that merge prepping Arm DT support 13 years ago, they
"temporarily" include each other. They also include platform_device.h
and of.h. As a result, there's a pretty much random mix of those include
files used throughout the tree. In order to detangle these headers and
replace the implicit includes with struct declarations, users need to
explicitly include the correct includes.

Signed-off-by: Rob Herring 
---
 drivers/misc/cxl/base.c| 1 +
 drivers/misc/fastrpc.c | 1 +
 drivers/misc/lis3lv02d/lis3lv02d.c | 2 +-
 drivers/misc/qcom-coincell.c   | 1 -
 drivers/misc/sram.c| 2 +-
 drivers/misc/vcpu_stall_detector.c | 1 -
 drivers/misc/xilinx_sdfec.c| 4 +++-
 drivers/misc/xilinx_tmr_inject.c   | 3 ++-
 drivers/misc/xilinx_tmr_manager.c  | 3 ++-
 9 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/drivers/misc/cxl/base.c b/drivers/misc/cxl/base.c
index cc0caf9192dc..b054562c046e 100644
--- a/drivers/misc/cxl/base.c
+++ b/drivers/misc/cxl/base.c
@@ -7,6 +7,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include "cxl.h"
 
diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c
index 9666d28037e1..1c7c0532da6f 100644
--- a/drivers/misc/fastrpc.c
+++ b/drivers/misc/fastrpc.c
@@ -13,6 +13,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/drivers/misc/lis3lv02d/lis3lv02d.c 
b/drivers/misc/lis3lv02d/lis3lv02d.c
index 299d316f1bda..49868a45c0ad 100644
--- a/drivers/misc/lis3lv02d/lis3lv02d.c
+++ b/drivers/misc/lis3lv02d/lis3lv02d.c
@@ -26,7 +26,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include "lis3lv02d.h"
 
 #define DRIVER_NAME "lis3lv02d"
diff --git a/drivers/misc/qcom-coincell.c b/drivers/misc/qcom-coincell.c
index 54d4f6ee..3c57f7429147 100644
--- a/drivers/misc/qcom-coincell.c
+++ b/drivers/misc/qcom-coincell.c
@@ -8,7 +8,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 
 struct qcom_coincell {
diff --git a/drivers/misc/sram.c b/drivers/misc/sram.c
index 5757adf418b1..a88f92cf35be 100644
--- a/drivers/misc/sram.c
+++ b/drivers/misc/sram.c
@@ -10,8 +10,8 @@
 #include 
 #include 
 #include 
+#include 
 #include 
-#include 
 #include 
 #include 
 #include 
diff --git a/drivers/misc/vcpu_stall_detector.c 
b/drivers/misc/vcpu_stall_detector.c
index 53b5506080e1..6479c962da1a 100644
--- a/drivers/misc/vcpu_stall_detector.c
+++ b/drivers/misc/vcpu_stall_detector.c
@@ -13,7 +13,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
diff --git a/drivers/misc/xilinx_sdfec.c b/drivers/misc/xilinx_sdfec.c
index 270ff4c5971a..35941c006552 100644
--- a/drivers/misc/xilinx_sdfec.c
+++ b/drivers/misc/xilinx_sdfec.c
@@ -15,12 +15,14 @@
 #include 
 #include 
 #include 
-#include 
+#include 
+#include 
 #include 
 #include 
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
diff --git a/drivers/misc/xilinx_tmr_inject.c b/drivers/misc/xilinx_tmr_inject.c
index d96f6d7cd109..9fc5835bfebc 100644
--- a/drivers/misc/xilinx_tmr_inject.c
+++ b/drivers/misc/xilinx_tmr_inject.c
@@ -11,7 +11,8 @@
 
 #include 
 #include 
-#include 
+#include 
+#include 
 #include 
 
 /* TMR Inject Register offsets */
diff --git a/drivers/misc/xilinx_tmr_manager.c 
b/drivers/misc/xilinx_tmr_manager.c
index 0ef55e06d3a0..3e4e40c3766f 100644
--- a/drivers/misc/xilinx_tmr_manager.c
+++ b/drivers/misc/xilinx_tmr_manager.c
@@ -15,7 +15,8 @@
 
 #include 
 #include 
-#include 
+#include 
+#include 
 
 /* TMR Manager Register offsets */
 #define XTMR_MANAGER_CR_OFFSET 0x0
-- 
2.40.1



[PATCH] macintosh: Explicitly include correct DT includes

2023-07-14 Thread Rob Herring
The DT of_device.h and of_platform.h date back to the separate
of_platform_bus_type before it as merged into the regular platform bus.
As part of that merge prepping Arm DT support 13 years ago, they
"temporarily" include each other. They also include platform_device.h
and of.h. As a result, there's a pretty much random mix of those include
files used throughout the tree. In order to detangle these headers and
replace the implicit includes with struct declarations, users need to
explicitly include the correct includes.

Signed-off-by: Rob Herring 
---
 drivers/macintosh/ams/ams.h  |  1 -
 drivers/macintosh/smu.c  |  1 +
 drivers/macintosh/therm_adt746x.c|  2 ++
 drivers/macintosh/therm_windtunnel.c | 22 --
 drivers/macintosh/windfarm_lm75_sensor.c |  4 ++--
 5 files changed, 17 insertions(+), 13 deletions(-)

diff --git a/drivers/macintosh/ams/ams.h b/drivers/macintosh/ams/ams.h
index 2c159c8844c1..e053c1515460 100644
--- a/drivers/macintosh/ams/ams.h
+++ b/drivers/macintosh/ams/ams.h
@@ -8,7 +8,6 @@
 #include 
 #include 
 #include 
-#include 
 
 enum ams_irq {
AMS_IRQ_FREEFALL = 0x01,
diff --git a/drivers/macintosh/smu.c b/drivers/macintosh/smu.c
index 5183a00529f5..b2b78a53e532 100644
--- a/drivers/macintosh/smu.c
+++ b/drivers/macintosh/smu.c
@@ -37,6 +37,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
diff --git a/drivers/macintosh/therm_adt746x.c 
b/drivers/macintosh/therm_adt746x.c
index 53ea56b286f9..00693741f744 100644
--- a/drivers/macintosh/therm_adt746x.c
+++ b/drivers/macintosh/therm_adt746x.c
@@ -25,7 +25,9 @@
 #include 
 #include 
 #include 
+#include 
 #include 
+#include 
 
 #include 
 #include 
diff --git a/drivers/macintosh/therm_windtunnel.c 
b/drivers/macintosh/therm_windtunnel.c
index 18a982454321..52289de15058 100644
--- a/drivers/macintosh/therm_windtunnel.c
+++ b/drivers/macintosh/therm_windtunnel.c
@@ -1,9 +1,9 @@
-/* 
+/*
  *   Creation Date: <2003/03/14 20:54:13 samuel>
  *   Time-stamp: <2004/03/20 14:20:59 samuel>
- *   
+ *
  * 
- * 
+ *
  * The G4 "windtunnel" has a single fan controlled by an
  * ADM1030 fan controller and a DS1775 thermostat.
  *
@@ -20,11 +20,11 @@
  *   Copyright (C) 2003, 2004 Samuel Rydh (sam...@ibrium.se)
  *
  *   Loosely based upon 'thermostat.c' written by Benjamin Herrenschmidt
- *   
+ *
  *   This program is free software; you can redistribute it and/or
  *   modify it under the terms of the GNU General Public License
  *   as published by the Free Software Foundation
- *   
+ *
  */
 
 #include 
@@ -36,7 +36,9 @@
 #include 
 #include 
 #include 
+#include 
 #include 
+#include 
 
 #include 
 #include 
@@ -48,10 +50,10 @@
 static struct {
volatile intrunning;
struct task_struct  *poll_task;
-   
+
struct mutexlock;
struct platform_device  *of_dev;
-   
+
struct i2c_client   *thermostat;
struct i2c_client   *fan;
 
@@ -127,7 +129,7 @@ write_reg( struct i2c_client *cl, int reg, int data, int 
len )
tmp[1] = (len == 1) ? data : (data >> 8);
tmp[2] = data;
len++;
-   
+
if( i2c_master_send(cl, tmp, len) != len )
return -ENODEV;
return 0;
@@ -369,7 +371,7 @@ attach_fan( struct i2c_client *cl )
 }
 
 static int
-attach_thermostat( struct i2c_client *cl ) 
+attach_thermostat( struct i2c_client *cl )
 {
int hyst_temp, os_temp, temp;
 
@@ -378,7 +380,7 @@ attach_thermostat( struct i2c_client *cl )
 
if( (temp=read_reg(cl, 0, 2)) < 0 )
goto out;
-   
+
/* temperature sanity check */
if( temp < 0x1600 || temp > 0x3c00 )
goto out;
diff --git a/drivers/macintosh/windfarm_lm75_sensor.c 
b/drivers/macintosh/windfarm_lm75_sensor.c
index 48dbdb2bda15..6b26e0f92105 100644
--- a/drivers/macintosh/windfarm_lm75_sensor.c
+++ b/drivers/macintosh/windfarm_lm75_sensor.c
@@ -14,7 +14,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -128,7 +128,7 @@ static int wf_lm75_probe(struct i2c_client *client)
name = "cpu-inlet-temp-1";
else
return -ENXIO;
-   
+
 
lm = kzalloc(sizeof(struct wf_lm75_sensor), GFP_KERNEL);
if (lm == NULL)
-- 
2.40.1



[PATCH] dmaengine: Explicitly include correct DT includes

2023-07-14 Thread Rob Herring
The DT of_device.h and of_platform.h date back to the separate
of_platform_bus_type before it as merged into the regular platform bus.
As part of that merge prepping Arm DT support 13 years ago, they
"temporarily" include each other. They also include platform_device.h
and of.h. As a result, there's a pretty much random mix of those include
files used throughout the tree. In order to detangle these headers and
replace the implicit includes with struct declarations, users need to
explicitly include the correct includes.

Signed-off-by: Rob Herring 
---
 drivers/dma/apple-admac.c  | 3 ++-
 drivers/dma/at_hdmac.c | 2 +-
 drivers/dma/bcm-sba-raid.c | 4 +++-
 drivers/dma/bestcomm/bestcomm.c| 4 +---
 drivers/dma/dma-jz4780.c   | 1 -
 drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c | 1 -
 drivers/dma/dw/rzn1-dmamux.c   | 4 +++-
 drivers/dma/fsl-qdma.c | 4 ++--
 drivers/dma/fsl_raid.c | 3 ++-
 drivers/dma/fsldma.c   | 3 ++-
 drivers/dma/img-mdc-dma.c  | 1 -
 drivers/dma/imx-dma.c  | 2 +-
 drivers/dma/imx-sdma.c | 1 -
 drivers/dma/lpc18xx-dmamux.c   | 4 +++-
 drivers/dma/mediatek/mtk-cqdma.c   | 1 -
 drivers/dma/mediatek/mtk-hsdma.c   | 1 -
 drivers/dma/mediatek/mtk-uart-apdma.c  | 1 -
 drivers/dma/mpc512x_dma.c  | 4 ++--
 drivers/dma/mxs-dma.c  | 1 -
 drivers/dma/nbpfaxi.c  | 1 -
 drivers/dma/owl-dma.c  | 3 ++-
 drivers/dma/ppc4xx/adma.c  | 2 +-
 drivers/dma/qcom/hidma.c   | 2 +-
 drivers/dma/sh/shdmac.c| 1 -
 drivers/dma/sprd-dma.c | 2 +-
 drivers/dma/stm32-dmamux.c | 4 +++-
 drivers/dma/stm32-mdma.c   | 1 -
 drivers/dma/sun6i-dma.c| 2 +-
 drivers/dma/tegra186-gpc-dma.c | 2 +-
 drivers/dma/tegra20-apb-dma.c  | 1 -
 drivers/dma/tegra210-adma.c| 3 ++-
 drivers/dma/ti/dma-crossbar.c  | 5 +++--
 drivers/dma/ti/edma.c  | 1 -
 drivers/dma/ti/k3-udma-private.c   | 2 ++
 drivers/dma/ti/k3-udma.c   | 1 -
 drivers/dma/ti/omap-dma.c  | 2 +-
 drivers/dma/xgene-dma.c| 3 ++-
 drivers/dma/xilinx/xilinx_dma.c| 4 ++--
 drivers/dma/xilinx/zynqmp_dma.c| 3 ++-
 39 files changed, 46 insertions(+), 44 deletions(-)

diff --git a/drivers/dma/apple-admac.c b/drivers/dma/apple-admac.c
index 4cf8da77bdd9..3af795635c5c 100644
--- a/drivers/dma/apple-admac.c
+++ b/drivers/dma/apple-admac.c
@@ -10,8 +10,9 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c
index ee3a219e3a89..b2876f67471f 100644
--- a/drivers/dma/at_hdmac.c
+++ b/drivers/dma/at_hdmac.c
@@ -20,7 +20,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
diff --git a/drivers/dma/bcm-sba-raid.c b/drivers/dma/bcm-sba-raid.c
index 064761289a73..94ea35330eb5 100644
--- a/drivers/dma/bcm-sba-raid.c
+++ b/drivers/dma/bcm-sba-raid.c
@@ -35,7 +35,9 @@
 #include 
 #include 
 #include 
-#include 
+#include 
+#include 
+#include 
 #include 
 #include 
 
diff --git a/drivers/dma/bestcomm/bestcomm.c b/drivers/dma/bestcomm/bestcomm.c
index eabbcfcaa7cb..466dd9919c4a 100644
--- a/drivers/dma/bestcomm/bestcomm.c
+++ b/drivers/dma/bestcomm/bestcomm.c
@@ -14,9 +14,7 @@
 #include 
 #include 
 #include 
-#include 
-#include 
-#include 
+#include 
 #include 
 #include 
 #include 
diff --git a/drivers/dma/dma-jz4780.c b/drivers/dma/dma-jz4780.c
index 9c1a6e9a9c03..adbd47bd6adf 100644
--- a/drivers/dma/dma-jz4780.c
+++ b/drivers/dma/dma-jz4780.c
@@ -13,7 +13,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
diff --git a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c 
b/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
index 796b6caf0bab..dd02f84e404d 100644
--- a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
+++ b/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
@@ -21,7 +21,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
diff --git a/drivers/dma/dw/rzn1-dmamux.c b/drivers/dma/dw/rzn1-dmamux.c
index f9912c3dd4d7..4fb8508419db 100644
--- a/drivers/dma/dw/rzn1-dmamux.c
+++ b/drivers/dma/dw/rzn1-dmamux.c
@@ -5,8 +5,10 @@
  * Based on TI crossbar driver written by Peter Ujfalusi 

  */
 #include 
-#include 
+#include 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
diff --git a/drivers/dma/fsl-qdma.c b/drivers/dma/fsl-qd

[PATCH] char: Explicitly include correct DT includes

2023-07-14 Thread Rob Herring
The DT of_device.h and of_platform.h date back to the separate
of_platform_bus_type before it as merged into the regular platform bus.
As part of that merge prepping Arm DT support 13 years ago, they
"temporarily" include each other. They also include platform_device.h
and of.h. As a result, there's a pretty much random mix of those include
files used throughout the tree. In order to detangle these headers and
replace the implicit includes with struct declarations, users need to
explicitly include the correct includes.

Signed-off-by: Rob Herring 
---
 drivers/char/agp/uninorth-agp.c| 1 +
 drivers/char/bsr.c | 3 +--
 drivers/char/hw_random/atmel-rng.c | 2 +-
 drivers/char/hw_random/bcm2835-rng.c   | 3 +--
 drivers/char/hw_random/ingenic-trng.c  | 2 +-
 drivers/char/hw_random/iproc-rng200.c  | 3 +--
 drivers/char/hw_random/npcm-rng.c  | 3 +--
 drivers/char/hw_random/omap-rng.c  | 2 --
 drivers/char/hw_random/omap3-rom-rng.c | 1 -
 drivers/char/hw_random/pasemi-rng.c| 3 +--
 drivers/char/hw_random/pic32-rng.c | 3 +--
 drivers/char/hw_random/stm32-rng.c | 3 ++-
 drivers/char/hw_random/xgene-rng.c | 5 ++---
 drivers/char/hw_random/xiphera-trng.c  | 1 -
 drivers/char/ipmi/kcs_bmc_aspeed.c | 1 -
 drivers/char/tpm/tpm_ftpm_tee.c| 1 -
 drivers/char/tpm/tpm_tis.c | 1 -
 drivers/char/tpm/tpm_tis_spi_main.c| 2 +-
 drivers/char/tpm/tpm_tis_synquacer.c   | 1 -
 19 files changed, 14 insertions(+), 27 deletions(-)

diff --git a/drivers/char/agp/uninorth-agp.c b/drivers/char/agp/uninorth-agp.c
index 62de7f4ba864..84411b13c49f 100644
--- a/drivers/char/agp/uninorth-agp.c
+++ b/drivers/char/agp/uninorth-agp.c
@@ -3,6 +3,7 @@
  * UniNorth AGPGART routines.
  */
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/drivers/char/bsr.c b/drivers/char/bsr.c
index 12143854aeac..70d31aed9011 100644
--- a/drivers/char/bsr.c
+++ b/drivers/char/bsr.c
@@ -6,11 +6,10 @@
  * Author: Sonny Rao 
  */
 
+#include 
 #include 
 #include 
 #include 
-#include 
-#include 
 #include 
 #include 
 #include 
diff --git a/drivers/char/hw_random/atmel-rng.c 
b/drivers/char/hw_random/atmel-rng.c
index b8effe77d80f..a37367ebcbac 100644
--- a/drivers/char/hw_random/atmel-rng.c
+++ b/drivers/char/hw_random/atmel-rng.c
@@ -15,7 +15,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 
diff --git a/drivers/char/hw_random/bcm2835-rng.c 
b/drivers/char/hw_random/bcm2835-rng.c
index e98fcac578d6..e19b0f9f48b9 100644
--- a/drivers/char/hw_random/bcm2835-rng.c
+++ b/drivers/char/hw_random/bcm2835-rng.c
@@ -8,8 +8,7 @@
 #include 
 #include 
 #include 
-#include 
-#include 
+#include 
 #include 
 #include 
 #include 
diff --git a/drivers/char/hw_random/ingenic-trng.c 
b/drivers/char/hw_random/ingenic-trng.c
index 0eb80f786f4d..759445d4f65a 100644
--- a/drivers/char/hw_random/ingenic-trng.c
+++ b/drivers/char/hw_random/ingenic-trng.c
@@ -11,8 +11,8 @@
 #include 
 #include 
 #include 
+#include 
 #include 
-#include 
 #include 
 #include 
 
diff --git a/drivers/char/hw_random/iproc-rng200.c 
b/drivers/char/hw_random/iproc-rng200.c
index 06bc060534d8..34df3f0d3e45 100644
--- a/drivers/char/hw_random/iproc-rng200.c
+++ b/drivers/char/hw_random/iproc-rng200.c
@@ -12,8 +12,7 @@
 #include 
 #include 
 #include 
-#include 
-#include 
+#include 
 #include 
 #include 
 
diff --git a/drivers/char/hw_random/npcm-rng.c 
b/drivers/char/hw_random/npcm-rng.c
index 9903d0357e06..8a304b754217 100644
--- a/drivers/char/hw_random/npcm-rng.c
+++ b/drivers/char/hw_random/npcm-rng.c
@@ -8,12 +8,11 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
-#include 
 #include 
-#include 
 
 #define NPCM_RNGCS_REG 0x00/* Control and status register */
 #define NPCM_RNGD_REG  0x04/* Data register */
diff --git a/drivers/char/hw_random/omap-rng.c 
b/drivers/char/hw_random/omap-rng.c
index 00ff96703dd2..be03f76a2a80 100644
--- a/drivers/char/hw_random/omap-rng.c
+++ b/drivers/char/hw_random/omap-rng.c
@@ -26,8 +26,6 @@
 #include 
 #include 
 #include 
-#include 
-#include 
 #include 
 #include 
 #include 
diff --git a/drivers/char/hw_random/omap3-rom-rng.c 
b/drivers/char/hw_random/omap3-rom-rng.c
index f06e4f95114f..18dc46b1b58e 100644
--- a/drivers/char/hw_random/omap3-rom-rng.c
+++ b/drivers/char/hw_random/omap3-rom-rng.c
@@ -20,7 +20,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 
diff --git a/drivers/char/hw_random/pasemi-rng.c 
b/drivers/char/hw_random/pasemi-rng.c
index 2498d4ef9fe2..6959d6edd44c 100644
--- a/drivers/char/hw_random/pasemi-rng.c
+++ b/drivers/char/hw_random/pasemi-rng.c
@@ -9,11 +9,10 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
-#include 
-#include 
 #include 
 
 #define SDCRNG_CTL_REG 0x00
diff --git a/drivers/char/hw_random/pic32-rng.c 
b/drivers/char/hw_random/pic32-rng.c
index 99c8bd0859a1..728b68b1a496 100644
---

[PATCH] powerpc: Explicitly include correct DT includes

2023-07-14 Thread Rob Herring
The DT of_device.h and of_platform.h date back to the separate
of_platform_bus_type before it as merged into the regular platform bus.
As part of that merge prepping Arm DT support 13 years ago, they
"temporarily" include each other. They also include platform_device.h
and of.h. As a result, there's a pretty much random mix of those include
files used throughout the tree. In order to detangle these headers and
replace the implicit includes with struct declarations, users need to
explicitly include the correct includes.

Signed-off-by: Rob Herring 
---
 arch/powerpc/include/asm/ibmebus.h  | 2 ++
 arch/powerpc/include/asm/macio.h| 3 ++-
 arch/powerpc/kernel/legacy_serial.c | 2 +-
 arch/powerpc/kernel/of_platform.c   | 4 +---
 arch/powerpc/kernel/setup-common.c  | 4 ++--
 arch/powerpc/kexec/file_load_64.c   | 2 +-
 arch/powerpc/kexec/ranges.c | 2 +-
 arch/powerpc/platforms/4xx/cpm.c| 2 +-
 arch/powerpc/platforms/4xx/hsta_msi.c   | 2 +-
 arch/powerpc/platforms/4xx/soc.c| 2 +-
 arch/powerpc/platforms/512x/mpc5121_ads.c   | 2 +-
 arch/powerpc/platforms/512x/mpc512x_generic.c   | 2 +-
 arch/powerpc/platforms/512x/mpc512x_lpbfifo.c   | 2 +-
 arch/powerpc/platforms/512x/pdm360ng.c  | 3 ++-
 arch/powerpc/platforms/52xx/mpc52xx_gpt.c   | 3 +--
 arch/powerpc/platforms/82xx/ep8248e.c   | 1 +
 arch/powerpc/platforms/83xx/km83xx.c| 4 ++--
 arch/powerpc/platforms/83xx/suspend.c   | 2 +-
 arch/powerpc/platforms/85xx/bsc913x_qds.c   | 2 +-
 arch/powerpc/platforms/85xx/bsc913x_rdb.c   | 2 +-
 arch/powerpc/platforms/85xx/c293pcie.c  | 3 +--
 arch/powerpc/platforms/85xx/ge_imp3a.c  | 2 +-
 arch/powerpc/platforms/85xx/ksi8560.c   | 3 ++-
 arch/powerpc/platforms/85xx/mpc8536_ds.c| 2 +-
 arch/powerpc/platforms/85xx/mpc85xx_ds.c| 2 +-
 arch/powerpc/platforms/85xx/mpc85xx_mds.c   | 4 ++--
 arch/powerpc/platforms/85xx/mpc85xx_rdb.c   | 3 ++-
 arch/powerpc/platforms/85xx/p1010rdb.c  | 2 +-
 arch/powerpc/platforms/85xx/p1022_ds.c  | 2 +-
 arch/powerpc/platforms/85xx/p1022_rdk.c | 2 +-
 arch/powerpc/platforms/85xx/p1023_rdb.c | 3 +--
 arch/powerpc/platforms/85xx/socrates.c  | 2 +-
 arch/powerpc/platforms/85xx/socrates_fpga_pic.c | 1 -
 arch/powerpc/platforms/85xx/stx_gp3.c   | 2 +-
 arch/powerpc/platforms/85xx/tqm85xx.c   | 2 +-
 arch/powerpc/platforms/85xx/twr_p102x.c | 3 ++-
 arch/powerpc/platforms/85xx/xes_mpc85xx.c   | 2 +-
 arch/powerpc/platforms/86xx/gef_ppc9a.c | 2 +-
 arch/powerpc/platforms/86xx/gef_sbc310.c| 2 +-
 arch/powerpc/platforms/86xx/gef_sbc610.c| 2 +-
 arch/powerpc/platforms/86xx/mvme7100.c  | 1 -
 arch/powerpc/platforms/86xx/pic.c   | 2 +-
 arch/powerpc/platforms/cell/axon_msi.c  | 3 ++-
 arch/powerpc/platforms/cell/cbe_regs.c  | 3 +--
 arch/powerpc/platforms/cell/iommu.c | 2 +-
 arch/powerpc/platforms/cell/setup.c | 1 +
 arch/powerpc/platforms/cell/spider-pci.c| 1 -
 arch/powerpc/platforms/embedded6xx/holly.c  | 2 +-
 arch/powerpc/platforms/maple/setup.c| 4 ++--
 arch/powerpc/platforms/pasemi/gpio_mdio.c   | 2 +-
 arch/powerpc/platforms/pasemi/setup.c   | 2 ++
 arch/powerpc/platforms/powermac/setup.c | 2 +-
 arch/powerpc/platforms/powernv/opal-imc.c   | 1 -
 arch/powerpc/platforms/powernv/opal-rtc.c   | 3 ++-
 arch/powerpc/platforms/powernv/opal-secvar.c| 2 +-
 arch/powerpc/platforms/powernv/opal-sensor.c| 2 ++
 arch/powerpc/platforms/pseries/ibmebus.c| 1 +
 arch/powerpc/sysdev/cpm_common.c| 2 --
 arch/powerpc/sysdev/cpm_gpio.c  | 3 ++-
 arch/powerpc/sysdev/fsl_pmc.c   | 4 ++--
 arch/powerpc/sysdev/fsl_rio.c   | 4 ++--
 arch/powerpc/sysdev/fsl_rmu.c   | 1 -
 arch/powerpc/sysdev/fsl_soc.c   | 1 -
 arch/powerpc/sysdev/mpic_msgr.c | 3 ++-
 arch/powerpc/sysdev/mpic_timer.c| 1 -
 arch/powerpc/sysdev/of_rtc.c| 3 ++-
 arch/powerpc/sysdev/pmi.c   | 4 ++--
 67 files changed, 79 insertions(+), 75 deletions(-)

diff --git a/arch/powerpc/include/asm/ibmebus.h 
b/arch/powerpc/include/asm/ibmebus.h
index 088f95b2e14f..6f33253a364a 100644
--- a/arch/powerpc/include/asm/ibmebus.h
+++ b/arch/powerpc/include/asm/ibmebus.h
@@ -46,6 +46,8 @@
 #include 
 #include 
 
+struct platform_driver;
+
 extern struct bus_type ibmebus_bus_type;
 
 int ibmebus_register_driver(struct platform_driver *drv);
diff --git a/arch/powerpc/include/asm/macio.h b/arch/powerpc/include/asm/macio.h
index ff5fd82d9ff0..3a07c62973aa 100644
--- a/arch/powerpc/include/asm/macio.h
+++ b/arch/powerpc/include/asm/macio.h
@@ -3,7 +3,8 @

Re: [PATCH] cpufreq: pmac32: Use of_property_read_reg() to parse "reg"

2023-06-30 Thread Rob Herring
On Fri, Jun 9, 2023 at 12:31 PM Rob Herring  wrote:
>
> Use the recently added of_property_read_reg() helper to get the
> untranslated "reg" address value.
>
> Signed-off-by: Rob Herring 
> ---
>  drivers/cpufreq/pmac32-cpufreq.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)

Ping!

>
> diff --git a/drivers/cpufreq/pmac32-cpufreq.c 
> b/drivers/cpufreq/pmac32-cpufreq.c
> index ec75e79659ac..f53635ba16c1 100644
> --- a/drivers/cpufreq/pmac32-cpufreq.c
> +++ b/drivers/cpufreq/pmac32-cpufreq.c
> @@ -378,10 +378,9 @@ static int pmac_cpufreq_cpu_init(struct cpufreq_policy 
> *policy)
>
>  static u32 read_gpio(struct device_node *np)
>  {
> -   const u32 *reg = of_get_property(np, "reg", NULL);
> -   u32 offset;
> +   u64 offset;
>
> -   if (reg == NULL)
> +   if (of_property_read_reg(np, 0, , NULL) < 0)
> return 0;
> /* That works for all keylargos but shall be fixed properly
>  * some day... The problem is that it seems we can't rely
> --
> 2.39.2
>


[PATCH] powerpc: 52xx: Make immr_id DT match tables static

2023-06-14 Thread Rob Herring
In some builds, the mpc52xx_pm_prepare()/lite5200_pm_prepare() functions
generate stack size warnings. The addition of 'struct resource' in commit
2500763dd3db ("powerpc: Use of_address_to_resource()") grew the stack size
and is blamed for the warnings. However, the real issue is there's no
reason the 'struct of_device_id immr_ids' DT match tables need to be on
the stack as they are constant. Declare them as static to move them off
the stack.

Reported-by: kernel test robot 
Closes: 
https://lore.kernel.org/oe-kbuild-all/202306130405.utv5yozd-...@intel.com/
Signed-off-by: Rob Herring 
---
 arch/powerpc/platforms/52xx/lite5200_pm.c | 2 +-
 arch/powerpc/platforms/52xx/mpc52xx_pm.c  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/platforms/52xx/lite5200_pm.c 
b/arch/powerpc/platforms/52xx/lite5200_pm.c
index ee29b63fca16..4900f5f48cce 100644
--- a/arch/powerpc/platforms/52xx/lite5200_pm.c
+++ b/arch/powerpc/platforms/52xx/lite5200_pm.c
@@ -47,7 +47,7 @@ static int lite5200_pm_begin(suspend_state_t state)
 static int lite5200_pm_prepare(void)
 {
struct device_node *np;
-   const struct of_device_id immr_ids[] = {
+   static const struct of_device_id immr_ids[] = {
{ .compatible = "fsl,mpc5200-immr", },
{ .compatible = "fsl,mpc5200b-immr", },
{ .type = "soc", .compatible = "mpc5200", }, /* lite5200 */
diff --git a/arch/powerpc/platforms/52xx/mpc52xx_pm.c 
b/arch/powerpc/platforms/52xx/mpc52xx_pm.c
index 549b3629e39a..f0c31ae15da5 100644
--- a/arch/powerpc/platforms/52xx/mpc52xx_pm.c
+++ b/arch/powerpc/platforms/52xx/mpc52xx_pm.c
@@ -60,7 +60,7 @@ int mpc52xx_set_wakeup_gpio(u8 pin, u8 level)
 int mpc52xx_pm_prepare(void)
 {
struct device_node *np;
-   const struct of_device_id immr_ids[] = {
+   static const struct of_device_id immr_ids[] = {
{ .compatible = "fsl,mpc5200-immr", },
{ .compatible = "fsl,mpc5200b-immr", },
{ .type = "soc", .compatible = "mpc5200", }, /* lite5200 */
-- 
2.39.2



[PATCH] powerpc: fsl_rio: Use of_range_to_resource() for "ranges" parsing

2023-06-09 Thread Rob Herring
"ranges" is a standard property with common parsing functions. Users
shouldn't be implementing their own parsing of it. Refactor the FSL RapidIO
"ranges" parsing to use of_range_to_resource() instead.

One change is the original code would look for "#size-cells" and
"#address-cells" in the parent node if not found in the port child
nodes. That is non-standard behavior and not necessary AFAICT. In 2011
in commit 54986964c13c ("powerpc/85xx: Update SRIO device tree nodes")
there was an ABI break. The upstream .dts files have been correct since
at least that point.

Signed-off-by: Rob Herring 
---
 arch/powerpc/sysdev/fsl_rio.c | 34 --
 1 file changed, 8 insertions(+), 26 deletions(-)

diff --git a/arch/powerpc/sysdev/fsl_rio.c b/arch/powerpc/sysdev/fsl_rio.c
index f8e492ee54cc..18176d0df612 100644
--- a/arch/powerpc/sysdev/fsl_rio.c
+++ b/arch/powerpc/sysdev/fsl_rio.c
@@ -453,8 +453,8 @@ int fsl_rio_setup(struct platform_device *dev)
struct device_node *np, *rmu_node;
int rlen;
u32 ccsr;
-   u64 range_start, range_size;
-   int paw, aw, sw;
+   u64 range_start;
+   int aw;
u32 i;
static int tmp;
struct device_node *rmu_np[MAX_MSG_UNIT_NUM] = {NULL};
@@ -569,6 +569,8 @@ int fsl_rio_setup(struct platform_device *dev)
 
/*set up ports node*/
for_each_child_of_node(dev->dev.of_node, np) {
+   struct resource res;
+
port_index = of_get_property(np, "cell-index", NULL);
if (!port_index) {
dev_err(>dev, "Can't get %pOF property 
'cell-index'\n",
@@ -576,32 +578,14 @@ int fsl_rio_setup(struct platform_device *dev)
continue;
}
 
-   dt_range = of_get_property(np, "ranges", );
-   if (!dt_range) {
+   if (of_range_to_resource(np, 0, )) {
dev_err(>dev, "Can't get %pOF property 'ranges'\n",
np);
continue;
}
 
-   /* Get node address wide */
-   cell = of_get_property(np, "#address-cells", NULL);
-   if (cell)
-   aw = *cell;
-   else
-   aw = of_n_addr_cells(np);
-   /* Get node size wide */
-   cell = of_get_property(np, "#size-cells", NULL);
-   if (cell)
-   sw = *cell;
-   else
-   sw = of_n_size_cells(np);
-   /* Get parent address wide wide */
-   paw = of_n_addr_cells(np);
-   range_start = of_read_number(dt_range + aw, paw);
-   range_size = of_read_number(dt_range + aw + paw, sw);
-
-   dev_info(>dev, "%pOF: LAW start 0x%016llx, size 
0x%016llx.\n",
-   np, range_start, range_size);
+   dev_info(>dev, "%pOF: LAW %pR\n",
+   np, );
 
port = kzalloc(sizeof(struct rio_mport), GFP_KERNEL);
if (!port)
@@ -624,9 +608,7 @@ int fsl_rio_setup(struct platform_device *dev)
}
 
INIT_LIST_HEAD(>dbells);
-   port->iores.start = range_start;
-   port->iores.end = port->iores.start + range_size - 1;
-   port->iores.flags = IORESOURCE_MEM;
+   port->iores = res;  /* struct copy */
port->iores.name = "rio_io_win";
 
if (request_resource(_resource, >iores) < 0) {
-- 
2.39.2



  1   2   3   4   5   6   7   8   9   10   >