Lines Matching defs:udd

38     struct UartDriverData *udd = (struct UartDriverData *)data;
41 if (udd == NULL || udd->private == NULL) {
45 port = (struct UartPl011Port *)udd->private;
54 if (udd->num != CONSOLE_UART) {
61 udd->recv(udd, buf, count);
69 static void Pl011ConfigBaudrate(const struct UartDriverData *udd, const struct UartPl011Port *port)
77 tmp = (uint64_t)IBRD_COEFFICIENTS * (uint64_t)udd->baudrate;
79 HDF_LOGE("%s: err, baudrate %u is invalid", __func__, udd->baudrate);
83 value = IBRD_COEFFICIENTS * udd->baudrate;
86 value = (FBRD_COEFFICIENTS * remainder) / udd->baudrate;
92 static void Pl011ConfigDataBits(const struct UartDriverData *udd, uint32_t *lcrh)
95 switch (udd->attr.dataBits) {
112 static void Pl011ConfigParity(const struct UartDriverData *udd, uint32_t *lcrh)
114 switch (udd->attr.parity) {
145 static void Pl011ConfigStopBits(const struct UartDriverData *udd, uint32_t *lcrh)
147 switch (udd->attr.stopBits) {
158 static void Pl011ConfigLCRH(const struct UartDriverData *udd, const struct UartPl011Port *port, uint32_t lcrh)
160 Pl011ConfigDataBits(udd, &lcrh);
164 Pl011ConfigParity(udd, &lcrh);
165 Pl011ConfigStopBits(udd, &lcrh);
166 if (udd->attr.fifoRxEn || udd->attr.fifoTxEn) {
172 static int32_t Pl011ConfigIn(struct UartDriverData *udd)
178 port = (struct UartPl011Port *)udd->private;
190 if (UART_ATTR_CTS_EN == udd->attr.cts) {
195 if (UART_ATTR_RTS_EN == udd->attr.rts) {
207 Pl011ConfigBaudrate(udd, port);
210 Pl011ConfigLCRH(udd, port, lcrh);
218 static int32_t Pl011StartUp(struct UartDriverData *udd)
224 if (udd == NULL) {
225 HDF_LOGE("%s: udd is null", __func__);
228 port = (struct UartPl011Port *)udd->private;
235 uart_clk_cfg(udd->num, true);
246 if (!(udd->flags & UART_FLG_DMA_RX)) {
248 ret = OsalRegisterIrq(port->irqNum, 0, Pl011Irq, "uart_pl011", udd);
259 ret = Pl011ConfigIn(udd);
263 static int32_t Pl011ShutDown(struct UartDriverData *udd)
268 if (udd == NULL) {
269 HDF_LOGE("%s: udd is null", __func__);
272 port = (struct UartPl011Port *)udd->private;
280 OsalUnregisterIrq(port->irqNum, udd);
298 uart_clk_cfg(udd->num, false);
303 static int32_t Pl011StartTx(struct UartDriverData *udd, const char *buf, size_t count)
307 if (udd == NULL || buf == NULL || count == 0) {
311 port = (struct UartPl011Port *)udd->private;
321 static int32_t Pl011Config(struct UartDriverData *udd)
326 if (udd == NULL) {
327 HDF_LOGE("%s: udd is null", __func__);
330 port = (struct UartPl011Port *)udd->private;
343 return Pl011ConfigIn(udd);
355 int32_t Pl011Read(struct UartDriverData *udd, char *buf, size_t count)
363 if (udd == NULL || buf == NULL || count == 0 || udd->rxTransfer == NULL) {
367 wp = udd->rxTransfer->wp;
368 rp = udd->rxTransfer->rp;
369 data = (unsigned long)(udd->rxTransfer->data);
396 udd->rxTransfer->rp = rp;
410 int32_t PL011UartRecvNotify(struct UartDriverData *udd, const char *buf, size_t count)
418 if (udd == NULL || buf == NULL || count == 0 || udd->rxTransfer == NULL) {
422 wp = udd->rxTransfer->wp;
423 rp = udd->rxTransfer->rp;
424 data = (unsigned long)(udd->rxTransfer->data);
448 if (Pl011Notify(&udd->wait) != HDF_SUCCESS) {
452 udd->rxTransfer->wp = wp;
456 bool PL011UartRxBufEmpty(struct UartDriverData *udd)
458 struct UartTransfer *transfer = udd->rxTransfer;