Re: mcp251x: read oscillator frequency?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Nov 11, 2019 at 11:28:14AM +0100, Marc Kleine-Budde wrote:
> I successfully got a mcp25625 (which is basically a mcp2515 with
> internal phy) running on a rapsi using the frequency printed on the
> oscillator in the DT-overlay.

I came across this patch by Andy on the linux-can archives:

[PATCH v2] can: mcp251x: Get rid of legacy platform data
https://www.spinics.net/lists/linux-can/msg02407.html

The description:
Instead of using legacy platform data, switch to use device properties.
For clock frequency we are using well established clock-frequency property.

I reads the clock-frequency property from device tree:
 
 	freq = clk_get_rate(clk);
-	if (freq == 0 && pdata)
-		freq = pdata->oscillator_frequency;
+	if (freq == 0)
+		device_property_read_u32(&spi->dev, "clock-frequency", &freq);
 

I feel like this is currently missing from mcp251x.c.  I don't see how it is 
reading the clock frequency from Device Tree as I don't see any code in the
current mcp251x.c to read device tree properties.

I would appreciate any insights to improve my understanding.

Thank you,
Drew



[Index of Archives]     [Automotive Discussions]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [CAN Bus]

  Powered by Linux