| công cụ tìm kiếm bảng dữ liệu linh kiện điện tử |
|
UM0851 bảng dữ liệu(PDF) 89 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
UM0851 bảng dữ liệu(HTML) 89 Page - STMicroelectronics |
|
89 / 245 page ![]() UM0851 Communication device drivers Doc ID 16604 Rev 2 89/245 SPI shows up in sysfs in several locations: ● /sys/devices/.../CTLR ... physical node for a given SPI controller ● /sys/devices/.../CTLR/spiB.C ... spi_device on bus "B", chipselect C, accessed through CTLR. ● /sys/bus/spi/devices/spiB.C ... symlink to that physical .../CTLR/spiB.C device ● /sys/devices/.../CTLR/spiB.C/modalias ... identifies the driver that should be used with this device (for hot plug/cold plug) ● /sys/bus/spi/drivers/D ... driver for one or more spi*.* devices. ● /sys/class/spi_master/spiB ... symlink (or actual device node) to a logical node which could hold class related state for the controller managing bus "B". All spiB.* devices share one physical SPI bus segment, with SCLK, MOSI, and MISO. Linux SPI framework provides some functions that are used for registering and un- registering SPI slave drivers. It also provides some functions for transferring data over the SPI bus. We will examine these functions one by one with examples from the EEPROM driver. Adding a new slave device The SPI controller driver and slave driver need some board-specific data to work correctly. This data is present in arch/arm/mach-spear300/spear300.c or arch/arm/mach- spear600/spear600.c. There are two types of platform information: ● Controller_data: this is required by the SPI controller driver. This structure is controller driver specific and for adding a new slave device, it must be supplied. /* to be implemented if chip select is configurable. Currently it is automatically given.*/ static void spidev_chip_select(u32 command) { } /*struct spear_spi_chip is present in drivers/spi/spr_ssp_pl022.h*/ static struct spear_spi_chip m25_hw = { .Interface= MOTOROLA_SPI, /* framework supports only MOTOROLA_SPI */ .cs_control= m25_chip_select, /* Slave driver provides cs_control function, and this function must enable or disable chip select of the slave chip */ .dma_burst_size = BURST_SIZE_1, /* framework Dma burst size supported by SPI slave chip supports */ }; ● Platform_data: this is defined and required by the slave driver. The driver can keep important data here for programming the slave device. static struct spi_eeprom m25_info = { .byte_len = 1024*1024, .name = "m25", .page_size = 256, .sector_size = 0x10000, .flags = EE_ADDR3, }; These two structures are added to struct spi_board_info, which is registered with the kernel. struct spi_board_info is declared by the Linux SPI framework. You must create an instance of this structure for every device which will use the SPI framework. |
|
Link URL |
| Cho đến nay ALLDATASHEET có giúp ích cho doanh nghiệp của bạn hay không? [ DONATE ] |
Alldatasheet là | Quảng cáo | Liên lạc với chúng tôi | Chính sách bảo mật | Liên kết đến bảng dữ liệu | Trao đổi link | Tìm kiếm theo nhà sản xuất All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |