



下載本文檔
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)
文檔簡介
1、Driver for Samsung S3C6400 and S3C6410 SoC onboard UARTs.Copyright 2008 Openmoko, Inc.Copyright 2008 Simtec ElectronicsBen Dooks HYPERLINK http:/armlinux.simtec.co.uk/ http:/armlinux.simtec.co.uk/This program is free software; you can redistribute it and/or modifyit under the terms of the GNU Genera
2、l Public License version 2 aspublished by the Free Software Foundation.*/#include #include #include #include #include #include #include #include #include #include #include “Samsung.hstatic int s3c6400_serial_setsource(struct uart_port *port, struct s3c24xx_uart_clksrc *clk)(unsigned long ucon = rd_r
3、egl(port, S3C2410_UCON);if (strcmp (字符串函數(shù),比較兩個字符串的大小)(clk-name, “ucIkO”) = 0) ucon &= S3C6400_UCON_CLKMASK;ucon | = S3C6400_UCON_UCLK0; else if (strcmp(clk-name, uclkl) = 0)ucon | = S3C6400_UCON_UCLK1;else if (strcmp(clk-name, ,pclk,) = 0) (/* See notes about transitioning from UCLK to PCLK */ ucon
4、&= S3C6400_UCON_UCLK0; else (printk(KERN_ERR unknown clock source %sn, clk-name);return -EINVAL;wr_regl(port, S3C2410_UCON, ucon);return 0;static int s3c6400_serial_getsource(struct uart_port *port, struct s3c24xx_uart_clksrc *clk)(u32 ucon = rd_regl(port S3C2410_UCON);clk-divisor = 1;switch (ucon &
5、 S3C6400_UCON_CLKMASK) case S3C6400_UCON_UCLK0:clk-name = ucIkO;break;case S3C6400_UCON_UCLK1:clk-name = uclkl1;break;case S3C6400_UCON_PCLK:case S3C6400_UCON_PCLK2:clk-name = pclk”;break;return 0;static int s3c6400_serial_resetport(struct uart_port *port, struct s3c2410_uartcfg *cfg)(unsigned long
6、ucon = rd_regl(portz S3C2410_UCON);dbg(Hs3c6400_serial_resetport: port=%p (%08lx), cfg=%pn/ port, port-mapbase, cfg);/* ensure we dont change the clock settings. */ucon &= S3C6400_UCON_CLKMASK;wr_regl(port, S3C2410_UCON, ucon | cfg-ucon);wr_regl(port, S3C2410_ULCON, cfg-ulcon);/* reset both fifos */
7、wr_regl(port,S3C2410_UFCON, cfg-ufcon | S3C2410_UFCON_RESETBOTH);wr_regl(port, S3C2410_UFCON, cfg-ufcon);return 0;)static struct s3c24xx_uartjnfo s3c6400_uart_inf = .name= Samsung S3C6400 UART”,.type= PORT_S3C6400,.fifosize = 64,.rxjifomask= S3C2440_U FSTAT_RX M ASK,.rxjifoshift= S3C2440_U FSTAT_RXS
8、H I FT,.rxjifofull= S3C2440_UFSTAT_RXFULL,.txjifofull= S3C2440_UFSTAT_TXFULL,.txjifomask= S3C2440_UFSTAT_TXMASK,.txjifoshift= S3C2440_U FSTAT_TXSH I FT,get_clksrc= s3c6400_serial_getsource,.set_clksrc= s3c6400_serial_setsource,reset_port= s3c6400_serial_resetport,); /* device management */static int
9、 s3c6400_serial_probe(struct platform_device *dev) (dbg(”s3c6400_serial_probe: dev=%pn,/ dev);return -s3c24xx_serial_probe(dev, &s3c6400_uart_inf);static struct platform_driver s3c6400_serial_drv = (.probe= s3c6400_serial_probe,.remove= s3c24xx_serial_remove,.driver= .name= s3c6400uart,.owner= THIS_
10、MODULE,, );s3c24xx_console_init(&s3c6400_serial_drv, &s3c6400_uart_inf);static int _init s3c6400_serial_init(void)(return s3c24xx_serial_init(&s3c6400_serial_drv, &s3c6400_uart_inf);static void _exit s3c6400_serial_exit(void)(platform_driver_unregister(&s3c6400_serial_drv);module Jnit(s3c6400_serialJnit);module_exit(s3c6400_serial_exit
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 二零二五年度教育培訓(xùn)檔口租賃合同
- T-ZJCX 0046-2024 簾子線直捻機
- 二零二五年度公車私用行為規(guī)范與責(zé)任追究協(xié)議
- 二零二五年度全新碼頭租賃協(xié)議及倉儲服務(wù)合作協(xié)議
- 2025年度果園租賃與農(nóng)業(yè)科技研發(fā)合同
- 二零二五年度廣告代理合同解除與權(quán)益調(diào)整協(xié)議
- 2025年度高科技企業(yè)計件工資勞動合同
- 2025年度智能合同履約跟蹤與風(fēng)險控制管理辦法
- 2025年度消防設(shè)施定期維護與消防通道清理合同
- 二零二五年度美發(fā)店員工勞動健康保險與意外傷害合同
- 臺州模具行業(yè)現(xiàn)狀分析
- 小學(xué)數(shù)學(xué)(含奧數(shù))數(shù)圖形個數(shù)和找規(guī)律、簡便運算專項及練習(xí)題附答案
- Android Studio開發(fā)實戰(zhàn)(從零基礎(chǔ)到App上線)
- 藥物警戒培訓(xùn)
- 中央民族大學(xué) 學(xué)生休學(xué)申請表
- 哈薩克斯坦勞動法中文版
- 創(chuàng)傷病人的氣道管理課件
- MULAND深圳蕉內(nèi)前海中心辦公室方案
- 液化氣噴火槍安全操作規(guī)程
- 教科版五年級下冊科學(xué)同步練習(xí)全冊
- 2023九年級數(shù)學(xué)中考復(fù)習(xí)計劃
評論
0/150
提交評論