Thread (5 messages) 5 messages, 4 authors, 2021-07-15

Re: Re: [PATCH V2] serial: 8250_pnp: Support configurable clock frequency

From: 陈华才 <hidden>
Date: 2021-07-14 02:36:10

Hi, Andy


&gt; -----原始邮件-----
&gt; 发件人: andy@surfacebook.localdomain
&gt; 发送时间: 2021-07-13 04:34:41 (星期二)
&gt; 收件人: "Huacai Chen" [off-list ref]
&gt; 抄送: "Greg Kroah-Hartman" [off-list ref], linux-serial@vger.kernel.org, "Xuefeng Li" [off-list ref], "Jiaxun Yang" [off-list ref], "Jianmin Lv" [off-list ref]
&gt; 主题: Re: [PATCH V2] serial: 8250_pnp: Support configurable clock frequency
&gt; 
&gt; Mon, Jul 05, 2021 at 09:00:10PM +0800, Huacai Chen kirjoitti:
&gt; &gt; From: Jianmin Lv [off-list ref]
&gt; &gt; 
&gt; &gt; ACPI-based Loongson boards need configurable rather than fixed clock
&gt; &gt; frequency for serial ports.
&gt; 
&gt; ...
&gt; 
&gt; &gt;  #include <linux kernel.h="">
&gt; &gt;  #include <linux serial_core.h="">
&gt; &gt;  #include <linux bitops.h="">
&gt; &gt; +#include <linux property.h="">
&gt; 
&gt; Can you try to keep it ordered (to some extend), please?
Existing headers is not in order, should I sort them completely?

&gt; 
&gt; ...
&gt; 
&gt; &gt;  	uart.port.flags |= UPF_SKIP_TEST | UPF_BOOT_AUTOCONF;
&gt; &gt;  	if (pnp_irq_flags(dev, 0) &amp; IORESOURCE_IRQ_SHAREABLE)
&gt; &gt;  		uart.port.flags |= UPF_SHARE_IRQ;
&gt; &gt; -	uart.port.uartclk = 1843200;
&gt; &gt; +	if (device_property_read_u32(&amp;dev-&gt;dev, "clock-frequency", &amp;uart.port.uartclk))
&gt; &gt; +		uart.port.uartclk = 1843200;
&gt; &gt;  	uart.port.dev = &amp;dev-&gt;dev;
&gt; 
&gt; You can avoid conditional completely by calling 
&gt; 
&gt; 	device_property_read_u32(&amp;dev-&gt;dev, "clock-frequency", &amp;uart.port.uartclk);
I want to get the property by this function, and set to default value (1843200) if fails. If remove the condition, how to set the default? Thanks.

Huacai
&gt; 
&gt; here.
&gt; 
&gt; -- 
&gt; With Best Regards,
&gt; Andy Shevchenko
&gt; 
</linux></linux></linux></linux>[off-list ref][off-list ref][off-list ref][off-list ref][off-list ref][off-list ref]
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help