Lines Matching defs:udd

37     struct UartDriverData *udd = (struct UartDriverData *)data;
40 if (udd == NULL || udd->private == NULL) {
44 port = (struct UartPl011Port *)udd->private;
53 if (udd->num != CONSOLE_UART) {
60 udd->recv(udd, buf, count);
68 static void Pl011ConfigBaudrate(const struct UartDriverData *udd, const struct UartPl011Port *port)
76 tmp = (uint64_t)IBRD_COEFFICIENTS * (uint64_t)udd->baudrate;
78 HDF_LOGE("%s: err, baudrate %u is invalid", __func__, udd->baudrate);
82 value = IBRD_COEFFICIENTS * udd->baudrate;
85 value = (FBRD_COEFFICIENTS * remainder) / udd->baudrate;
91 static void Pl011ConfigDataBits(const struct UartDriverData *udd, uint32_t *lcrh)
94 switch (udd->attr.dataBits) {
111 static void Pl011ConfigParity(const struct UartDriverData *udd, uint32_t *lcrh)
113 switch (udd->attr.parity) {
144 static void Pl011ConfigStopBits(const struct UartDriverData *udd, uint32_t *lcrh)
146 switch (udd->attr.stopBits) {
157 static void Pl011ConfigLCRH(const struct UartDriverData *udd, const struct UartPl011Port *port, uint32_t lcrh)
159 Pl011ConfigDataBits(udd, &lcrh);
163 Pl011ConfigParity(udd, &lcrh);
164 Pl011ConfigStopBits(udd, &lcrh);
165 if (udd->attr.fifoRxEn || udd->attr.fifoTxEn) {
171 static int32_t Pl011ConfigIn(struct UartDriverData *udd)
177 port = (struct UartPl011Port *)udd->private;
189 if (UART_ATTR_CTS_EN == udd->attr.cts) {
194 if (UART_ATTR_RTS_EN == udd->attr.rts) {
206 Pl011ConfigBaudrate(udd, port);
209 Pl011ConfigLCRH(udd, port, lcrh);
217 static int32_t Pl011StartUp(struct UartDriverData *udd)
223 if (udd == NULL) {
224 HDF_LOGE("%s: udd is null", __func__);
227 port = (struct UartPl011Port *)udd->private;
234 uart_clk_cfg(udd->num, true);
245 if (!(udd->flags & UART_FLG_DMA_RX)) {
247 ret = OsalRegisterIrq(port->irqNum, 0, Pl011Irq, "uart_pl011", udd);
258 ret = Pl011ConfigIn(udd);
262 static int32_t Pl011ShutDown(struct UartDriverData *udd)
267 if (udd == NULL) {
268 HDF_LOGE("%s: udd is null", __func__);
271 port = (struct UartPl011Port *)udd->private;
279 OsalUnregisterIrq(port->irqNum, udd);
297 uart_clk_cfg(udd->num, false);
302 static int32_t Pl011StartTx(struct UartDriverData *udd, const char *buf, size_t count)
306 if (udd == NULL || buf == NULL || count == 0) {
310 port = (struct UartPl011Port *)udd->private;
320 static int32_t Pl011Config(struct UartDriverData *udd)
325 if (udd == NULL) {
326 HDF_LOGE("%s: udd is null", __func__);
329 port = (struct UartPl011Port *)udd->private;
342 return Pl011ConfigIn(udd);
354 int32_t Pl011Read(struct UartDriverData *udd, char *buf, size_t count)
362 if (udd == NULL || buf == NULL || count == 0 || udd->rxTransfer == NULL) {
366 wp = udd->rxTransfer->wp;
367 rp = udd->rxTransfer->rp;
368 data = (unsigned long)(udd->rxTransfer->data);
395 udd->rxTransfer->rp = rp;
409 int32_t PL011UartRecvNotify(struct UartDriverData *udd, const char *buf, size_t count)
417 if (udd == NULL || buf == NULL || count == 0 || udd->rxTransfer == NULL) {
421 wp = udd->rxTransfer->wp;
422 rp = udd->rxTransfer->rp;
423 data = (unsigned long)(udd->rxTransfer->data);
447 if (Pl011Notify(&udd->wait) != HDF_SUCCESS) {
451 udd->rxTransfer->wp = wp;
455 bool PL011UartRxBufEmpty(struct UartDriverData *udd)
457 struct UartTransfer *transfer = udd->rxTransfer;