linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: Peter Ujfalusi <peter.ujfalusi@ti.com>
Cc: Paul Walmsley <paul@pwsan.com>,
	jarkko.nikula@bitmer.com, t-kristo@ti.com,
	linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v2 0/3] ARM: OMAP3: Fix McBSP2/3 hwmod setup for sidetone
Date: Tue, 12 Apr 2016 09:37:50 -0700	[thread overview]
Message-ID: <20160412163750.GR5995@atomide.com> (raw)
In-Reply-To: <570CC54E.6020703@ti.com>

* Peter Ujfalusi <peter.ujfalusi@ti.com> [160412 02:53]:
> Tony,
> 
> On 04/12/16 00:28, Tony Lindgren wrote:
> >>> Then for the long term solution using
> >>> PM runtime to block gating of the clock while sidetone is active is
> >>> the way to go it seems.
> >>
> >> Hrm, I think one of the main issue is that with pm_runtime we can not block
> >> the clock gating, this is why legacy code uses enable_st_clock(), which will
> >> call omap2_clk_deny_idle() or omap2_clk_allow_idle().
> > 
> > I see. I think Tero wanted to export omap2_clk_allow_idle() and
> > omap2_clk_deny_idle() for drivers to use. That should get discussed in
> > the linux-clk list, probably best to use the pdata callbacks until
> > the clock idling issue has been discussed.
> 
> It is already exported, used by the arch/arm/mach-omap2/mcbsp.c file.

Oh but not with EXPORT_SYMBOL so not usable except for built-in code.
Probably best to keep it that way IMO..

> Why not to remove the callback for legacy also and handle it in the driver? It
> is less ugly in my opinion.
> Going via the pdata callback is just going to cement the current setup.

Sure, maybe you can have a piece of built-in driver code to do that?

> I have drafted out something which would be needed if we separate the McBSP-ST
> from the McBSP driver. It is not pretty...
> 
> In the new omap3-mcbsp-st.h:
> 
> struct omap3_mcbspst;
> 
> struct omap_st_to_mcbsp_data {
> 	bool (*is_enabled)(struct omap_st_to_mcbsp_data *st_data);
> 	bool (*enable)(struct omap_st_to_mcbsp_data *st_data);
> 	bool (*disable)(struct omap_st_to_mcbsp_data *st_data);
> 	struct omap3_mcbspst *st_priv;
> };
> 
> In the current omap-mcbsp.h:
> 
> #include <omap3-mcbsp-st.h>
> ...
> struct omap_mcbsp_to_st_data {
> 	bool (*is_enabled)(struct omap_mcbsp_to_st_data *mcbsp_data);
> 	bool (*iclk_idle)(struct omap_mcbsp_to_st_data *mcbsp_data, bool allow);
> 	bool (*enable)(struct omap_mcbsp_to_st_data *mcbsp_data);
> 	bool (*disable)(struct omap_mcbsp_to_st_data *mcbsp_data);
> 	struct omap_mcbsp *mcbsp_priv;
> };
> 
> #ifdef CONFIG_SND_SOC_OMAP3_MCBSPST
> struct omap_mcbsp_to_st_data *omap_mcbsp_st_register(
> 						struct platform_device *pdev, /* McBSP pdev! probably? */
> 						struct omap_st_to_mcbsp_data *st_data);
> int omap_mcbsp_st_unregister(struct omap_st_to_mcbsp_data *st_data);
> #else
> static inline int omap_mcbsp_st_register(struct platform_device *pdev,
> 					 struct omap_st_to_mcbsp_data *st_data)
> {
> 	return -ENODEV;
> }
> static inline int omap_mcbsp_st_unregister(struct omap_st_to_mcbsp_data *st_data)
> {
> 	return 0;
> }
> #endif
> 
> Since the ST would be separate driver, it should create the needed ALSA
> controls as well, probably I need to pass something else here and there.
> But, in this setup it would be possible to remove the ST driver while the
> McBSP and the sound card is up, which means we must be able to remove
> kcontrols runtime, probably there is a way, but not sure about this.
> 
> There will be issues like this we have not prepared for I'm sure if we do
> dramatic change to the simple implementation we have right now.

Best to stick to incremental improvments I think..

> I have reasonably clean patches (6 of them) on top of this three which would
> remove the arch code for the iclk handling and implements it in the mcbsp
> driver w/o changing the architecture of the McBSP driver itself. Both DT and
> legacy boot works. The only part I was not happy about the one where I looked
> up the mcbsp2/3_ick, but I think I have found much cleaner way to do it
> (meaning that the code will not look hackish at all).
> If you want to see, I can make this change and I can send the whole thing as
> RFC and continue the discussion around that?

Sure, especially if that helps with splitting up the modules too.

Regards,

Tony

  reply	other threads:[~2016-04-12 16:37 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-18 14:23 [PATCH v2 0/3] ARM: OMAP3: Fix McBSP2/3 hwmod setup for sidetone Peter Ujfalusi
2016-03-18 14:23 ` [PATCH v2 1/3] ARM: DTS: omap3: Remove mcbsp2/3_sidetone hwmod reference for McBSP2/3 Peter Ujfalusi
2016-03-18 14:23 ` [PATCH v2 2/3] ARM: OMAP2+: mcbsp: Prepare the device build code for sidetone hwmod removal Peter Ujfalusi
2016-03-18 14:23 ` [PATCH v2 3/3] ARM: OMAP3: hwmod data: Merge and remove the McBSP sidetone related data Peter Ujfalusi
2016-03-19 19:38 ` [PATCH v2 0/3] ARM: OMAP3: Fix McBSP2/3 hwmod setup for sidetone Paul Walmsley
2016-03-21  8:57   ` Peter Ujfalusi
2016-03-21 17:44     ` Paul Walmsley
2016-04-01  9:33       ` Peter Ujfalusi
2016-04-02  0:17         ` Tony Lindgren
2016-04-04 12:45           ` Peter Ujfalusi
2016-04-04 15:12             ` Tony Lindgren
2016-04-05 13:15               ` Peter Ujfalusi
2016-04-11 21:28                 ` Tony Lindgren
2016-04-12  9:52                   ` Peter Ujfalusi
2016-04-12 16:37                     ` Tony Lindgren [this message]
2016-04-13 11:57                       ` Peter Ujfalusi
2016-04-13 15:28                         ` Tony Lindgren
2016-04-14  7:34                           ` Peter Ujfalusi
2016-04-14 16:55                             ` Tony Lindgren
2016-04-14 19:37                               ` Peter Ujfalusi
2016-04-14 20:34                                 ` Tony Lindgren
2016-04-15 10:23                                   ` Peter Ujfalusi
2016-04-15 15:16                                     ` Tony Lindgren
2016-04-15 19:50                                       ` Peter Ujfalusi
2016-04-18 23:51                                         ` Tony Lindgren
2016-04-22 13:12                                           ` Peter Ujfalusi
2016-04-22 22:24                                             ` Tony Lindgren

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160412163750.GR5995@atomide.com \
    --to=tony@atomide.com \
    --cc=devicetree@vger.kernel.org \
    --cc=jarkko.nikula@bitmer.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=paul@pwsan.com \
    --cc=peter.ujfalusi@ti.com \
    --cc=t-kristo@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).