linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tomi Valkeinen <tomi.valkeinen@ti.com>
To: Archit Taneja <a0393947@ti.com>
Cc: linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org, archit@ti.com
Subject: Re: [PATCH 08/21] OMAPDSS: clean up the omapdss platform data mess
Date: Thu, 08 Mar 2012 08:02:57 +0000	[thread overview]
Message-ID: <1331193777.2354.21.camel@deskari> (raw)
In-Reply-To: <4F57A4E5.6070201@ti.com>

[-- Attachment #1: Type: text/plain, Size: 3802 bytes --]

On Wed, 2012-03-07 at 23:41 +0530, Archit Taneja wrote:
> On Wednesday 07 March 2012 06:14 PM, Tomi Valkeinen wrote:
> > The omapdss pdata handling is a mess. This is more evident when trying
> > to use device tree for DSS, as we don't have platform data anymore in
> > that case. This patch cleans the pdata handling by:
> >
> > - Remove struct omap_display_platform_data. It was used just as a
> >    wrapper for struct omap_dss_board_info.
> > - Pass the platform data only to omapdss device. The drivers for omap
> >    dss hwmods do not need the platform data. This should also work better
> >    for DT, as we can create omapdss device programmatically in generic omap
> >    boot code, and thus we can pass the pdata to it.
> > - Create dss functions for get_ctx_loss_count and dsi_enable/disable_pads
> >    that the dss hwmod drivers can call.
> >
> > Signed-off-by: Tomi Valkeinen<tomi.valkeinen@ti.com>
> > ---
> >   arch/arm/mach-omap2/display.c   |   37 ++++++++++++++++++-------------------
> >   drivers/video/omap2/dss/core.c  |   35 +++++++++++++++++++++++++++++++++++
> >   drivers/video/omap2/dss/dispc.c |   21 ++-------------------
> >   drivers/video/omap2/dss/dsi.c   |   17 +++--------------
> >   drivers/video/omap2/dss/dss.h   |    3 +++
> >   drivers/video/omap2/dss/hdmi.c  |    2 --
> >   include/video/omapdss.h         |    5 -----
> >   7 files changed, 61 insertions(+), 59 deletions(-)
> >
> > diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c
> > index 3677b1f..279c124 100644
> > --- a/arch/arm/mach-omap2/display.c
> > +++ b/arch/arm/mach-omap2/display.c
> > @@ -185,10 +185,23 @@ int __init omap_display_init(struct omap_dss_board_info *board_data)
> >   	struct omap_hwmod *oh;
> >   	struct platform_device *pdev;
> >   	int i, oh_count;
> > -	struct omap_display_platform_data pdata;
> >   	const struct omap_dss_hwmod_data *curr_dss_hwmod;
> >
> > -	memset(&pdata, 0, sizeof(pdata));
> > +	/* create omapdss device */
> > +
> > +	board_data->dsi_enable_pads = omap_dsi_enable_pads;
> > +	board_data->dsi_disable_pads = omap_dsi_disable_pads;
> > +	board_data->get_context_loss_count = omap_pm_get_dev_context_loss_count;
> 
> Why are the checks for board data being NULL removed here?

We didn't check if board_data is NULL in the earlier version either. And
I don't think there's need to check that, because if the board file
calls this function, it should also give the board data.

However, the earlier version didn't set the func pointers if the func
pointer in the board_data was != NULL. Did you mean that? I removed that
check, as I don't see a need for it. The func pointers should be set by
this function, and I don't see why the board file would need to use its
own versions.

> > diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c
> > index 8613f86..3efd473 100644
> > --- a/drivers/video/omap2/dss/core.c
> > +++ b/drivers/video/omap2/dss/core.c
> > @@ -87,6 +87,41 @@ struct regulator *dss_get_vdds_sdi(void)
> >   	return reg;
> >   }
> >
> > +int dss_get_ctx_loss_count(struct device *dev)
> > +{
> > +	struct omap_dss_board_info *board_data = core.pdev->dev.platform_data;
> > +	int cnt;
> > +
> > +	if (!board_data || !board_data->get_context_loss_count)
> > +		return -ENOENT;
> 
> why do we check board_data being NULL here and not in omap_display_init()?

I added it for DT case, because then we don't have board_data for the
devices defined in the DT data. However, for now we always have the
board_data, and in this patch I should just move the code. So I'll
remove the check, and add it later with DT code if needed.

(and actually, I don' think the check is needed in DT case either...)

 Tomi





[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2012-03-08  8:02 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-07 12:44 [PATCH 00/21] OMAPDSS: DT preparation patches Tomi Valkeinen
2012-03-07 12:44 ` [PATCH 01/21] OMAPDSS: panel-dvi: add PD gpio handling Tomi Valkeinen
2012-03-07 17:59   ` Archit Taneja
2012-03-08  7:54     ` Tomi Valkeinen
2012-03-07 12:44 ` [PATCH 02/21] OMAP: board-files: remove custom PD GPIO handling for DVI output Tomi Valkeinen
2012-03-07 12:44 ` [PATCH 03/21] OMAPDSS: TFP410: rename dvi -> tfp410 Tomi Valkeinen
2012-03-07 12:44 ` [PATCH 04/21] OMAPDSS: TFP410: rename dvi files to tfp410 Tomi Valkeinen
2012-03-07 12:44 ` [PATCH 05/21] OMAPDSS: TFP410: pdata rewrite Tomi Valkeinen
2012-03-07 12:44 ` [PATCH 06/21] OMAPDSS: DSI: use dsi_get_dsidev_id(dsidev) instead of dsidev->id Tomi Valkeinen
2012-03-07 12:44 ` [PATCH 07/21] OMAPDSS: Taal: move reset gpio handling to taal driver Tomi Valkeinen
2012-03-07 12:44 ` [PATCH 08/21] OMAPDSS: clean up the omapdss platform data mess Tomi Valkeinen
2012-03-07 18:23   ` Archit Taneja
2012-03-08  8:02     ` Tomi Valkeinen [this message]
2012-03-08  8:29       ` Archit Taneja
2012-03-08  8:33         ` Tomi Valkeinen
2012-03-08  8:55           ` Archit Taneja
2012-03-07 12:44 ` [PATCH 09/21] OMAPDSS: remove return from platform_driver_unreg Tomi Valkeinen
2012-03-07 12:44 ` [PATCH 10/21] OMAPDSS: use platform_driver_probe for core/dispc/dss Tomi Valkeinen
2012-03-07 12:44 ` [PATCH 11/21] OMAPDSS: register dss drivers in module init Tomi Valkeinen
2012-03-07 12:44 ` [PATCH 12/21] OMAPDSS: create custom pdevs for DSS omap_devices Tomi Valkeinen
2012-03-07 12:44 ` [PATCH 13/21] OMAPDSS: create DPI & SDI devices Tomi Valkeinen
2012-03-07 12:44 ` [PATCH 14/21] OMAPDSS: create DPI & SDI drivers Tomi Valkeinen
2012-03-07 12:44 ` [PATCH 15/21] OMAPDSS: remove uses of dss_runtime_get/put Tomi Valkeinen
2012-03-07 12:44 ` [PATCH 16/21] OMAPDSS: handle output-driver reg/unreg more dynamically Tomi Valkeinen
2012-03-08  8:46   ` Archit Taneja
2012-03-08  8:46     ` Tomi Valkeinen
2012-03-08  9:34       ` Archit Taneja
2012-03-08  9:34         ` Tomi Valkeinen
2012-03-08  9:51           ` Archit Taneja
2012-03-07 12:44 ` [PATCH 17/21] OMAPDSS: move the creation of debugfs files Tomi Valkeinen
2012-03-07 12:44 ` [PATCH 18/21] OMAPDSS: use platform_driver_probe for dsi/hdmi/rfbi/venc/dpi/sdi Tomi Valkeinen
2012-03-07 12:44 ` [PATCH 19/21] OMAPDSS: add __init & __exit Tomi Valkeinen
2012-03-07 12:44 ` [PATCH 20/21] OMAPFB: " Tomi Valkeinen
2012-03-07 12:44 ` [PATCH 21/21] OMAPDSS: change default_device handling Tomi Valkeinen

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=1331193777.2354.21.camel@deskari \
    --to=tomi.valkeinen@ti.com \
    --cc=a0393947@ti.com \
    --cc=archit@ti.com \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    /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).