public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: archit taneja <archit@ti.com>
To: "DebBarma, Tarun Kanti" <tarun.kanti@ti.com>
Cc: "Valkeinen, Tomi" <tomi.valkeinen@ti.com>,
	"linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>
Subject: Re: [PATCH 1/3] OMAP: DSS2: Functions to request/release DSI VCs
Date: Tue, 1 Mar 2011 19:06:00 +0530	[thread overview]
Message-ID: <4D6CF640.8010301@ti.com> (raw)
In-Reply-To: <5A47E75E594F054BAF48C5E4FC4B92AB037A21436B@dbde02.ent.ti.com>

Hi,

On Tuesday 01 March 2011 06:50 PM, DebBarma, Tarun Kanti wrote:
>> -----Original Message-----
>> From: linux-omap-owner@vger.kernel.org [mailto:linux-omap-
>> owner@vger.kernel.org] On Behalf Of Taneja, Archit
>> Sent: Tuesday, March 01, 2011 6:02 PM
>> To: Valkeinen, Tomi
>> Cc: linux-omap@vger.kernel.org; Taneja, Archit
>> Subject: [PATCH 1/3] OMAP: DSS2: Functions to request/release DSI VCs
>>
>> Introduce functions which request and release VC's. This will be used in
>> panel
>> drivers in their probes.
>>
>> omap_dsi_request_vc() takes in the pointer to the omap_dss_device, the
>> VC_ID
>> parameter which goes into the header of the DSI packets, and returns a
>> Virtual
>> channel number (or virtual channel register set) which it can use.
>>
>> omap_dsi_set_vc_id() takes the omap_dss_device pointer, the Virtual
>> Channel
>> number and the VC_ID that needs to be set for the specifed Virtual
>> Channel.
>>
>> omap_dsi_releae_vc() takes the omap_dss_device pointer and the Virtual
>> Channel
>> number that needs to be made free.
>>
>> Initialisation of VC parameters is done in dsi_init().
>>
>> Signed-off-by: Archit Taneja<archit@ti.com>

<snip>

>> +int omap_dsi_request_vc(struct omap_dss_device *dssdev, int *channel)
> Since this is an export function it might be good to have standard comment
> Header.

Its meant to be used by another folder which is also a part of DSS2, 
other functions exported in this file don't have comments on them 
either. Not totally sure if comments are needed for this or not.

>> +{
>> +	int i;
>> +
>> +	for (i = 0; i<  4; i++) {
> Does it make sense to use a constant instead of hard coding 4?

This is a property of DSI HW which is quite unlikely to change with 
later version of OMAPs.

>> +		if (!dsi.vc[i].dssdev) {
>> +			dsi.vc[i].dssdev = dssdev;
>> +			*channel = i;
>> +			return 0;
>> +		}
>> +	}
>> +
>> +	DSSERR("cannot get VC for display %s", dssdev->name);
>> +	return -ENOSPC;
>> +}
>> +EXPORT_SYMBOL(omap_dsi_request_vc);
>> +
>> +int omap_dsi_set_vc_id(struct omap_dss_device *dssdev, int channel, int
>> vc_id)
>> +{
>> +	if (vc_id<  0 || vc_id>  4) {
>> +		DSSERR("VC ID out of range\n");
>> +		return -EINVAL;
>> +	}
>> +
>> +	if (dsi.vc[channel].dssdev == dssdev) {
>> +		dsi.vc[channel].vc_id = vc_id;
>> +		return 0;
>> +	}
>> +
> Might be a good idea to print some type of error message here?

The user of this function checks for errors and prints an error message 
very similar to what we would print here. Thats why I decided to skip here.

>> +	return -EINVAL;
>> +}
>> +EXPORT_SYMBOL(omap_dsi_set_vc_id);
>> +
>> +void omap_dsi_release_vc(struct omap_dss_device *dssdev, int channel)
>> +{
>> +	if (dsi.vc[channel].dssdev == dssdev) {
>> +		dsi.vc[channel].dssdev = NULL;
> Don't we have to free dssdev? Unless it is getting freed else where?

Its not really allocated at boot time, its a static structure filled up 
in the board file, setting to NULL just lets omap_dsi_request_vc() reuse it.

Thanks,
Archit

  reply	other threads:[~2011-03-01 13:33 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-01 12:32 [PATCH v2 0/3]OMAP: DSS2: Abstract away DSI VC information from dsi panel drivers Archit Taneja
2011-03-01 12:32 ` [PATCH 1/3] OMAP: DSS2: Functions to request/release DSI VCs Archit Taneja
2011-03-01 13:20   ` DebBarma, Tarun Kanti
2011-03-01 13:36     ` archit taneja [this message]
2011-03-01 16:09   ` Tomi Valkeinen
2011-03-01 12:32 ` [PATCH 2/3] OMAP: DSS2: Use request / release calls in Taal for DSI Virtual Channels Archit Taneja
2011-03-01 12:32 ` Archit Taneja
2011-03-01 12:34   ` archit taneja
2011-03-01 12:32 ` [PATCH 3/3] OMAP: DSS2: Taal: Use 2 DSI Virtual Channels for Taal Archit Taneja
2011-03-01 15:56 ` [PATCH v2 0/3]OMAP: DSS2: Abstract away DSI VC information from dsi panel drivers Tomi Valkeinen
2011-03-02  5:40   ` archit taneja
  -- strict thread matches above, loose matches on Subject: below --
2011-02-28  8:47 [PATCH " Archit Taneja
2011-02-28  8:47 ` [PATCH 1/3] OMAP: DSS2: Functions to request/release DSI VCs Archit Taneja
2011-02-28 12:51   ` Tomi Valkeinen
2011-03-01  5:17     ` archit taneja
2011-03-01  7:02       ` archit taneja
2011-02-28 14:10   ` Tomi Valkeinen
2011-03-01  5:21     ` archit taneja

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=4D6CF640.8010301@ti.com \
    --to=archit@ti.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=tarun.kanti@ti.com \
    --cc=tomi.valkeinen@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