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

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

 



Hi, Andy


> -----原始邮件-----
> 发件人: andy@surfacebook.localdomain
> 发送时间: 2021-07-13 04:34:41 (星期二)
&gt; 收件人: "Huacai Chen" <chenhuacai@xxxxxxxxxxx>
&gt; 抄送: "Greg Kroah-Hartman" <gregkh@xxxxxxxxxxxxxxxxxxx>, linux-serial@xxxxxxxxxxxxxxx, "Xuefeng Li" <lixuefeng@xxxxxxxxxxx>, "Jiaxun Yang" <jiaxun.yang@xxxxxxxxxxx>, "Jianmin Lv" <lvjianmin@xxxxxxxxxxx>
&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 <lvjianmin@xxxxxxxxxxx>
&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></lvjianmin@xxxxxxxxxxx></lvjianmin@xxxxxxxxxxx></jiaxun.yang@xxxxxxxxxxx></lixuefeng@xxxxxxxxxxx></gregkh@xxxxxxxxxxxxxxxxxxx></chenhuacai@xxxxxxxxxxx>




[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux