diff mbox series

[v3,6/8] kernel: package bcm53xx i2c module

Message ID 3f787818e4f2f2144473347f8d7a1acf0c6f3ff9.1599945264.git.chunkeey@gmail.com
State Superseded, archived
Headers show
Series [v3,1/8] scripts: mkits.sh make it possible to specify fdt@# | expand

Commit Message

Christian Lamparter Sept. 12, 2020, 9:15 p.m. UTC
The BCM5301x SoCs do have i2c. Since this is only
being used by the Meraki MR32, this will be packaged
as a module.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
---
 package/kernel/linux/modules/i2c.mk | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

Comments

Adrian Schmutzler Sept. 15, 2020, 11:28 a.m. UTC | #1
Hi,

> -----Original Message-----
> From: openwrt-devel [mailto:openwrt-devel-bounces@lists.openwrt.org]
> On Behalf Of Christian Lamparter
> Sent: Samstag, 12. September 2020 23:16
> To: openwrt-devel@lists.openwrt.org
> Cc: rafal@milecki.pl; hauke@hauke-m.de; f.fainelli@gmail.com;
> chrisrblake93@gmail.com; Adrian Schmutzler <mail@adrianschmutzler.de>
> Subject: [PATCH v3 6/8] kernel: package bcm53xx i2c module
> 
> The BCM5301x SoCs do have i2c. Since this is only being used by the Meraki
> MR32, this will be packaged as a module.
> 
> Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
> ---
>  package/kernel/linux/modules/i2c.mk | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
> 
> diff --git a/package/kernel/linux/modules/i2c.mk
> b/package/kernel/linux/modules/i2c.mk
> index ca6463c81b..1c8b1b844e 100644
> --- a/package/kernel/linux/modules/i2c.mk
> +++ b/package/kernel/linux/modules/i2c.mk
> @@ -259,3 +259,17 @@ endef
>  $(eval $(call KernelPackage,i2c-tiny-usb))
> 
> 
> +I2C_BCM_IPROC_MODULES:= \
> +  CONFIG_I2C_BCM_IPROC:drivers/i2c/busses/i2c-bcm-iproc
> +
> +define KernelPackage/i2c-bcm-iproc
> +  $(call i2c_defaults,$(I2C_BCM_IPROC_MODULES),59)
> +  TITLE:=Broadcom iProc I2C controller
> +  DEPENDS:=@TARGET_bcm53xx +kmod-i2c-core endef

More a question than a remark:

I always wonder whether stuff like this (depending on a single target) belongs into package/kernel/linux/modules/... or into target/linux/bcm53xx/modules.mk

Is there a general rule or is this mostly depending on circumstances/taste?

Best

Adrian

> +
> +define KernelPackage/i2c-bcm-iproc/description
> + Kernel module for the Broadcom iProc I2C controller.
> +endef
> +
> +$(eval $(call KernelPackage,i2c-bcm-iproc))
> --
> 2.28.0
> 
> 
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Daniel Golle Sept. 15, 2020, 11:47 a.m. UTC | #2
On Tue, Sep 15, 2020 at 01:28:23PM +0200, Adrian Schmutzler wrote:
> Hi,
> 
> > -----Original Message-----
> > From: openwrt-devel [mailto:openwrt-devel-bounces@lists.openwrt.org]
> > On Behalf Of Christian Lamparter
> > Sent: Samstag, 12. September 2020 23:16
> > To: openwrt-devel@lists.openwrt.org
> > Cc: rafal@milecki.pl; hauke@hauke-m.de; f.fainelli@gmail.com;
> > chrisrblake93@gmail.com; Adrian Schmutzler <mail@adrianschmutzler.de>
> > Subject: [PATCH v3 6/8] kernel: package bcm53xx i2c module
> > 
> > The BCM5301x SoCs do have i2c. Since this is only being used by the Meraki
> > MR32, this will be packaged as a module.
> > 
> > Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
> > ---
> >  package/kernel/linux/modules/i2c.mk | 14 ++++++++++++++
> >  1 file changed, 14 insertions(+)
> > 
> > diff --git a/package/kernel/linux/modules/i2c.mk
> > b/package/kernel/linux/modules/i2c.mk
> > index ca6463c81b..1c8b1b844e 100644
> > --- a/package/kernel/linux/modules/i2c.mk
> > +++ b/package/kernel/linux/modules/i2c.mk
> > @@ -259,3 +259,17 @@ endef
> >  $(eval $(call KernelPackage,i2c-tiny-usb))
> > 
> > 
> > +I2C_BCM_IPROC_MODULES:= \
> > +  CONFIG_I2C_BCM_IPROC:drivers/i2c/busses/i2c-bcm-iproc
> > +
> > +define KernelPackage/i2c-bcm-iproc
> > +  $(call i2c_defaults,$(I2C_BCM_IPROC_MODULES),59)
> > +  TITLE:=Broadcom iProc I2C controller
> > +  DEPENDS:=@TARGET_bcm53xx +kmod-i2c-core endef
> 
> More a question than a remark:
> 
> I always wonder whether stuff like this (depending on a single target) belongs into package/kernel/linux/modules/... or into target/linux/bcm53xx/modules.mk
> 
> Is there a general rule or is this mostly depending on circumstances/taste?

I'd say in a case like that (DEPENDS:=@TARGET_bcm53xx) it should go to
target/linux/bcm53xx/modules.mk. However, another idea of that can be
to list in-tree modules in package/kernel/linux/modules/... and target-
specific out-of-tree modules in target/linux/*/modules.mk.
I don't think we got a clear policy regarding that.

> 
> Best
> 
> Adrian
> 
> > +
> > +define KernelPackage/i2c-bcm-iproc/description
> > + Kernel module for the Broadcom iProc I2C controller.
> > +endef
> > +
> > +$(eval $(call KernelPackage,i2c-bcm-iproc))
> > --
> > 2.28.0
> > 
> > 
> > _______________________________________________
> > openwrt-devel mailing list
> > openwrt-devel@lists.openwrt.org
> > https://lists.openwrt.org/mailman/listinfo/openwrt-devel



> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Christian Lamparter Sept. 19, 2020, 1:41 p.m. UTC | #3
On 2020-09-15 13:47, Daniel Golle wrote:
> On Tue, Sep 15, 2020 at 01:28:23PM +0200, Adrian Schmutzler wrote:
>> Hi,
>>
>>> -----Original Message-----
>>> From: openwrt-devel [mailto:openwrt-devel-bounces@lists.openwrt.org]
>>> On Behalf Of Christian Lamparter
>>> Sent: Samstag, 12. September 2020 23:16
>>> To: openwrt-devel@lists.openwrt.org
>>> Cc: rafal@milecki.pl; hauke@hauke-m.de; f.fainelli@gmail.com;
>>> chrisrblake93@gmail.com; Adrian Schmutzler <mail@adrianschmutzler.de>
>>> Subject: [PATCH v3 6/8] kernel: package bcm53xx i2c module
>>>
>>> The BCM5301x SoCs do have i2c. Since this is only being used by the Meraki
>>> MR32, this will be packaged as a module.
>>>
>>> Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
>>> ---
>>>   package/kernel/linux/modules/i2c.mk | 14 ++++++++++++++
>>>   1 file changed, 14 insertions(+)
>>>
>>> diff --git a/package/kernel/linux/modules/i2c.mk
>>> b/package/kernel/linux/modules/i2c.mk
>>> index ca6463c81b..1c8b1b844e 100644
>>> --- a/package/kernel/linux/modules/i2c.mk
>>> +++ b/package/kernel/linux/modules/i2c.mk
>>> @@ -259,3 +259,17 @@ endef
>>>   $(eval $(call KernelPackage,i2c-tiny-usb))
>>>
>>>
>>> +I2C_BCM_IPROC_MODULES:= \
>>> +  CONFIG_I2C_BCM_IPROC:drivers/i2c/busses/i2c-bcm-iproc
>>> +
>>> +define KernelPackage/i2c-bcm-iproc
>>> +  $(call i2c_defaults,$(I2C_BCM_IPROC_MODULES),59)
>>> +  TITLE:=Broadcom iProc I2C controller
>>> +  DEPENDS:=@TARGET_bcm53xx +kmod-i2c-core endef
>>
>> More a question than a remark:
>>
>> I always wonder whether stuff like this (depending on a single target) belongs into package/kernel/linux/modules/... or into target/linux/bcm53xx/modules.mk
>>
>> Is there a general rule or is this mostly depending on circumstances/taste?
> 
> I'd say in a case like that (DEPENDS:=@TARGET_bcm53xx) it should go to
> target/linux/bcm53xx/modules.mk. However, another idea of that can be
> to list in-tree modules in package/kernel/linux/modules/... and target-
> specific out-of-tree modules in target/linux/*/modules.mk.
> I don't think we got a clear policy regarding that.

The bcm-iproc-i2c is also used by the arm64 stingray and northstar2
chips of broadcom's 802.11ax platform. That said, there isn't any
target for it so I might as well put the it into
target/linux/bcm53xx/modules.mk.

Cheers
Christian
diff mbox series

Patch

diff --git a/package/kernel/linux/modules/i2c.mk b/package/kernel/linux/modules/i2c.mk
index ca6463c81b..1c8b1b844e 100644
--- a/package/kernel/linux/modules/i2c.mk
+++ b/package/kernel/linux/modules/i2c.mk
@@ -259,3 +259,17 @@  endef
 $(eval $(call KernelPackage,i2c-tiny-usb))
 
 
+I2C_BCM_IPROC_MODULES:= \
+  CONFIG_I2C_BCM_IPROC:drivers/i2c/busses/i2c-bcm-iproc
+
+define KernelPackage/i2c-bcm-iproc
+  $(call i2c_defaults,$(I2C_BCM_IPROC_MODULES),59)
+  TITLE:=Broadcom iProc I2C controller
+  DEPENDS:=@TARGET_bcm53xx +kmod-i2c-core
+endef
+
+define KernelPackage/i2c-bcm-iproc/description
+ Kernel module for the Broadcom iProc I2C controller.
+endef
+
+$(eval $(call KernelPackage,i2c-bcm-iproc))