⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pxa27x_spi.c

📁 intel 32位CPUpxa27x的spi通信程序
💻 C
字号:
/*> From: Stephen Street <stephen@streetfiresound.com>> > The driver turns a PXA2xx synchronous serial port (SSP) into a SPI master > controller (see Documentation/spi/spi_summary). The driver has the following> features:I've not tested this on my PXA27x platform yet (I'll try and get thisdone this tomorrow) but a few comments.> --- linux-2.6.16-rc2/drivers/spi/pxa2xx_spi.c	1969-12-31 16:00:00.000000000 -0800> +++ linux-spi/drivers/spi/pxa2xx_spi.c	2006-02-06 18:39:45.339334630 -0800*/#define CLOCK_SPEED_HZ 3686400//PXA27x has a clock speed of 13000000 Hz.> +	chip->cr0 = SSCR0_SerClkDiv((CLOCK_SPEED_HZ / spi->max_speed_hz) + 2)Consider spi->max_speed_hz == CLOCK_SPEED_HZ which gives a divisor of 3(when it should be 1).You need SSCR0_SerClkDiv(CLOCK_SPEED_HZ / (spi->max_speed_hz + 1) + 1)for the correct divisor and for proper rounding./* Attach to IRQ */	irq = platform_get_irq(pdev, 0);	if (irq == 0) {		dev_err(&pdev->dev, "irq resource not defined\n");		status = -ENODEV;		goto out_error_master_alloc;	}Greg K-H has a patch pending that makes platform_get_irq() return -ENXIOinstead of 0 on error.  This is required for SSP3 on the PXA27x whichuses IRQ 0.> +	/* Release IRQ */> +	irq = platform_get_irq(pdev, 0);> +	if (irq != 0)> +		free_irq(irq, drv_data);Similarly.David Vrabel-- David Vrabel, Design EngineerArcom, Clifton Road           Tel: +44 (0)1223 411200 ext. 3233Cambridge CB1 7EA, UK         Web: http://www.arcom.com/-To unsubscribe from this list: send the line "unsubscribe linux-kernel" inthe body of a message to majordomo@vger.kernel.orgMore majordomo info at  http://vger.kernel.org/majordomo-info.htmlPlease read the FAQ at  http://www.tux.org/lkml

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -