2014-10-01 09:28:43

by Jean-Francois Moine

[permalink] [raw]
Subject: Re: [PATCH v6 2/2] drm/i2c:tda998x: Use the HDMI audio CODEC

On Tue, 30 Sep 2014 20:25:40 +0100
Mark Brown <[email protected]> wrote:

> > + request_module("snd-soc-hdmi-codec");
> > + pdev = platform_device_register_resndata(&priv->hdmi->dev,
> > + "hdmi-audio-codec",
> > + PLATFORM_DEVID_NONE,
> > + NULL, 0,
> > + &tda998x_hdmi_data,
> > + sizeof tda998x_hdmi_data);
>
> Why is this request_module() needed? If there is a good reason for it
> we should have some documentation.

The reason is simple: as the HDMI CODEC is not declared in the DT, the
associated module must be loaded in memory.

--
Ken ar c'hentaƱ | ** Breizh ha Linux atav! **
Jef | http://moinejf.free.fr/


2014-10-01 12:37:35

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH v6 2/2] drm/i2c:tda998x: Use the HDMI audio CODEC

On Wed, Oct 01, 2014 at 11:28:46AM +0200, Jean-Francois Moine wrote:
> Mark Brown <[email protected]> wrote:

> > > + request_module("snd-soc-hdmi-codec");
> > > + pdev = platform_device_register_resndata(&priv->hdmi->dev,
> > > + "hdmi-audio-codec",
> > > + PLATFORM_DEVID_NONE,
> > > + NULL, 0,
> > > + &tda998x_hdmi_data,
> > > + sizeof tda998x_hdmi_data);

> > Why is this request_module() needed? If there is a good reason for it
> > we should have some documentation.

> The reason is simple: as the HDMI CODEC is not declared in the DT, the
> associated module must be loaded in memory.

No, that doesn't make sense - there's absolutely no dependency on DT for
module loading, non-DT boards work perfectly fine. Think about this for
a minute, we don't have lots of request_module() calls in board files.
You're working around some other bug here.


Attachments:
(No filename) (893.00 B)
signature.asc (473.00 B)
Digital signature
Download all attachments

2014-10-01 13:47:51

by Russell King - ARM Linux

[permalink] [raw]
Subject: Re: [PATCH v6 2/2] drm/i2c:tda998x: Use the HDMI audio CODEC

On Wed, Oct 01, 2014 at 11:28:46AM +0200, Jean-Francois Moine wrote:
> On Tue, 30 Sep 2014 20:25:40 +0100
> Mark Brown <[email protected]> wrote:
>
> > > + request_module("snd-soc-hdmi-codec");
> > > + pdev = platform_device_register_resndata(&priv->hdmi->dev,
> > > + "hdmi-audio-codec",
> > > + PLATFORM_DEVID_NONE,
> > > + NULL, 0,
> > > + &tda998x_hdmi_data,
> > > + sizeof tda998x_hdmi_data);
> >
> > Why is this request_module() needed? If there is a good reason for it
> > we should have some documentation.
>
> The reason is simple: as the HDMI CODEC is not declared in the DT, the
> associated module must be loaded in memory.

Module auto-loading works in non-DT environments too. Unlike the
direction that the arm port is going, the core kernel features, such
as driver autoloading, are coded *not* to require DT (or indeed any
particular firmware.)

There are circumstances where this has been lost sight of (such as
the gpiod stuff), but as a general rule, features do not rely on DT.

Platform drivers will be auto-loaded if they have:

MODULE_ALIAS(PLATFORM_MODULE_PREFIX DRIVER_NAME);

and DRIVER_NAME matches the non-id part of the platform device name.
In the case of platform driver ID tables:

MODULE_DEVICE_TABLE(platform, id-table);

--
FTTC broadband for 0.8mile line: currently at 9.5Mbps down 400kbps up
according to speedtest.net.