Thread (1 message) 1 message, 1 author, 2012-02-28

Re: [PATCH v6 15/20] tegra: fdt: Add function to return peripheral/clock ID

From: Simon Glass <hidden>
Date: 2012-02-28 17:46:15
Also in: linux-tegra, u-boot

Possibly related (same subject, not in this thread)

Hi Stephen,

On Mon, Feb 27, 2012 at 3:41 PM, Stephen Warren [off-list ref] wrote:
On 02/27/2012 01:52 PM, Simon Glass wrote:
quoted
A common requirement is to find the clock ID for a peripheral. This is the
second cell of the 'clocks' property (the first being the phandle itself).
quoted
+int clock_decode_periph_id(const void *blob, int node)
quoted
+     valid = clock_periph_id_isvalid(id);
clock_periph_id_isvalid() is not the correct function to use here; the
code should be checking for invalid IDs in the CAR binding, not invalid
IDs in the HW periph ID definition. They're different.

Just to be explicit, the function you need here would be:

int clkid_to_periphid(int clkid)
{
   if (clk_id > 95)
       return -1;
   switch (clk_id) {
   case 1:
   case 2:
   case 7:
   case 10:
   case 20:
   case 30:
   case 35:
   case 49:
   case 56:
   case 74:
   case 77:
   case 78:
   case 79:
   case 80:
   case 81:
   case 82:
   case 83:
   case 91:
   case 95:
       return -1;
   default:
       return clkid;
   }
}
Ick.

Why is 7 in there, and did you miss 76? Also U-Boot only goes up to 88
at present so should I change the first test to match?

Regards,
Simon
--
nvpublic
--
To unsubscribe from this list: send the line "unsubscribe linux-tegra" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help