Updated: UCC TDM driver for QE based MPC83xx platforms.
Subsystems (3)
PATCH 2/3 Updated: UCC TDM driver for QE based MPC83xx platforms.
Incorporated Stephen's comments.
From: Poonam Agarwal-b10812 <[email protected]>
The UCC TDM driver basically multiplexes and demultiplexes data from different channels. It can interface with for example SLIC kind of devices to receive TDM data demultiplex it and send to upper modules. At the transmit end it receives data for different channels multiplexes it and sends them on the TDM channel. It internally uses TSA( Time Slot Assigner) which does multiplexing and demultiplexing, UCC to perform SDMA between host buffers and the TSA, CMX to connect TSA to UCC.
It can be used by a kernel module which can call tdm_register_client to get access to a TDM device.
The driver is right now a misc driver with no subsystem as such. There can be a platform independent TDM layer which is planned to be done after this. TDM bus sort of thing.
The dts file keeps a track of the TDM devices present on the board. Depending on them the TDM driver initializes those many driver instances while coming up.
The driver on the upper level can plug to more than one tdm clients depending on the availablity of TDM devices. At every new request of a TDM client to bind with a TDM device, a free driver instance is allocated to the client.
The interface can be described as follows.
tdm_register_client(struct tdm_client *)
This API returns a pointer to the structure tdm_client which is of
type
struct tdm_client {
u32 client_id;
u32 (*tdm_read)(u32 client_id, short chn_id, short
*pcm_buffer, short len);
u32 (*tdm_write)(u32 client_id, short chn_id, short
*pcm_buffer, short len);
wait_queue_head_t *wakeup_event;
}It consists of:
- client_id: It is basically to identify the particular TDM
device/driver instance.
- tdm_read: It is a function pointer returned by the TDM driver to be
used to read TDM data from a particular TDM channel.
- tdm_write: It is a function pointer returned by the TDM driver to be
used to write TDM data to a particular TDM channel.
- wakeup_event: It is address of a wait_queue event on which the client
keeps on sleeping, and the TDM driver wakes it up periodically. The driver is configured to
wake up the client after every 10ms.
Once the TDM client gets registered to a TDM driver instance and a TDM device, it interfaces with the driver using tdm_read, tdm_write and wakeup_event.
This driver will run on MPC8323E-RDB platforms.
--- drivers/misc/Kconfig | 14 + drivers/misc/Makefile | 1 + drivers/misc/ucc_tdm.c | 1017 ++++++++++++++++++++++++++++++++++++++++++++++++ drivers/misc/ucc_tdm.h | 221 +++++++++++ 4 files changed, 1253 insertions(+), 0 deletions(-) create mode 100644 drivers/misc/ucc_tdm.c create mode 100644 drivers/misc/ucc_tdm.h
drivers/misc/Kconfig +14 -0
@@ -232,4 +232,18 @@ config ATMEL_SSC If unsure, say N. +config UCC_TDM + bool "Freescale UCC TDM Driver" + depends on QUICC_ENGINE && UCC_FAST + default n + ---help--- + The TDM driver is for UCC based TDM devices for example, TDM device on + MPC832x RDB. Select it to run PowerVoIP on MPC832x RDB board. + The TDM driver can interface with SLIC kind of devices to transmit + and receive TDM samples. The TDM driver receives Time Division + multiplexed samples(for different channels) from the SLIC device, + demutiplexes them and sends them to the upper layers. At the transmit + end the TDM drivers receives samples for different channels, it + multiplexes them and sends them to the SLIC device. + endif # MISC_DEVICES
drivers/misc/Makefile +1 -0
@@ -17,3 +17,4 @@ obj-$(CONFIG_SONY_LAPTOP) += sony-laptop.o obj-$(CONFIG_THINKPAD_ACPI) += thinkpad_acpi.o obj-$(CONFIG_FUJITSU_LAPTOP) += fujitsu-laptop.o obj-$(CONFIG_EEPROM_93CX6) += eeprom_93cx6.o +obj-$(CONFIG_UCC_TDM) += ucc_tdm.o
drivers/misc/ucc_tdm.c new file +1017 -0
1,017 lines not on this page · raw message
drivers/misc/ucc_tdm.h new file +221 -0
221 lines not on this page · raw message
Signature · 1 line
1.5.2.4