Home
last modified time | relevance | path

Searched refs:msgs (Results 1 – 25 of 33) sorted by relevance

12

/drivers/hdf_core/framework/support/platform/src/i2c/
Di2c_msg.c17 int32_t AssignReplayBuffer(uint32_t lenReply, uint8_t **bufReply, struct I2cMsg *msgs, int16_t coun… in AssignReplayBuffer() argument
28 if ((msgs[i].flags & I2C_FLAG_READ) != 0) { in AssignReplayBuffer()
29 msgs[i].buf = buf; in AssignReplayBuffer()
30 buf += msgs[i].len; in AssignReplayBuffer()
44 struct I2cMsg *msgs = NULL; in RebuildMsgs() local
48 msgs = OsalMemCalloc(msgSize + sizeof(void *)); in RebuildMsgs()
49 if (msgs == NULL) { in RebuildMsgs()
53 bufReply = (uint8_t **)((uint8_t *)msgs + msgSize); in RebuildMsgs()
59 OsalMemFree(msgs); in RebuildMsgs()
62 msgs[i].addr = userMsgs->addr; in RebuildMsgs()
[all …]
Di2c_if_u.c205 static int32_t WriteI2cMsgs(struct HdfSBuf *data, struct I2cMsg *msgs, int16_t count) in WriteI2cMsgs() argument
216 userMsgs.addr = msgs[i].addr; in WriteI2cMsgs()
217 userMsgs.len = msgs[i].len; in WriteI2cMsgs()
218 userMsgs.flags = msgs[i].flags; in WriteI2cMsgs()
224 if (msgs[i].len > I2C_BUFF_SIZE || in WriteI2cMsgs()
225 ((msgs[i].flags & I2C_FLAG_READ) && (msgs[i].len + sizeof(uint64_t) > I2C_BUFF_SIZE))) { in WriteI2cMsgs()
226 HDF_LOGE("WriteI2cMsgs: msg data size %{public}u out of range!", msgs[i].len); in WriteI2cMsgs()
230 if (!HdfSbufWriteBuffer(data, (uint8_t *)msgs[i].buf, msgs[i].len)) { in WriteI2cMsgs()
266 static int32_t ReadI2cMsgs(struct HdfSBuf *reply, struct I2cMsg *msgs, int16_t count) in ReadI2cMsgs() argument
269 if ((msgs[i].flags & I2C_FLAG_READ) == 0) { in ReadI2cMsgs()
[all …]
Di2c_if.c33 int32_t I2cTransfer(DevHandle handle, struct I2cMsg *msgs, int16_t count) in I2cTransfer() argument
40 if (msgs == NULL || count <= 0) { in I2cTransfer()
41 HDF_LOGE("I2cTransfer: err params! msgs:%s, count:%hd!", (msgs == NULL) ? "0" : "x", count); in I2cTransfer()
45 return I2cCntlrTransfer((struct I2cCntlr *)handle, msgs, count); in I2cTransfer()
Di2c_core.c209 int32_t I2cCntlrTransfer(struct I2cCntlr *cntlr, struct I2cMsg *msgs, int16_t count) in I2cCntlrTransfer() argument
227 ret = cntlr->ops->transfer(cntlr, msgs, count); in I2cCntlrTransfer()
235 struct I2cMsg *msgs = NULL; in I2cIoDoTransfer() local
240 if (I2cMsgsRebuildFromSbuf(data, &msgs, &count) != HDF_SUCCESS) { in I2cIoDoTransfer()
245 transCnt = I2cCntlrTransfer(cntlr, msgs, count); in I2cIoDoTransfer()
247 I2cMsgsFree(msgs, count); in I2cIoDoTransfer()
252 if (I2cMsgsWriteToSbuf(msgs, count, reply) != HDF_SUCCESS) { in I2cIoDoTransfer()
256 I2cMsgsFree(msgs, count); in I2cIoDoTransfer()
/drivers/hdf_core/framework/support/platform/src/spi/
Dspi_core.c140 struct HdfSBuf *data, uint32_t count, uint8_t *tmpFlag, struct SpiMsg *msgs, uint32_t *lenReply) in SpiMsgsRwProcess() argument
155 msgs[i].len = userMsg->len; in SpiMsgsRwProcess()
156 msgs[i].speed = userMsg->speed; in SpiMsgsRwProcess()
157 msgs[i].delayUs = userMsg->delayUs; in SpiMsgsRwProcess()
158 msgs[i].keepCs = userMsg->keepCs; in SpiMsgsRwProcess()
159 msgs[i].rbuf = NULL; in SpiMsgsRwProcess()
160 msgs[i].wbuf = NULL; in SpiMsgsRwProcess()
162 (*lenReply) += msgs[i].len; in SpiMsgsRwProcess()
163 msgs[i].rbuf = tmpFlag; // tmpFlag is not mainpulated, only to mark rbuf not NULL in SpiMsgsRwProcess()
166 … ((!HdfSbufReadBuffer(data, (const void **)&buf, &len)) || (buf == NULL) || (len != msgs[i].len)) { in SpiMsgsRwProcess()
[all …]
Dspi_if_u.c55 static int32_t SpiMsgWriteArray(struct HdfSBuf *data, struct SpiMsg *msgs, uint32_t count, struct H… in SpiMsgWriteArray() argument
63 if (msgs[i].rbuf != NULL) { in SpiMsgWriteArray()
65 replyLen += msgs[i].len + sizeof(uint64_t); in SpiMsgWriteArray()
66 rbufLen += msgs[i].len; in SpiMsgWriteArray()
68 if (msgs[i].wbuf != NULL) { in SpiMsgWriteArray()
71 userMsg.len = msgs[i].len; in SpiMsgWriteArray()
72 userMsg.speed = msgs[i].speed; in SpiMsgWriteArray()
73 userMsg.delayUs = msgs[i].delayUs; in SpiMsgWriteArray()
74 userMsg.keepCs = msgs[i].keepCs; in SpiMsgWriteArray()
81 if (msgs[i].wbuf != NULL) { in SpiMsgWriteArray()
[all …]
Dspi_if.c39 int32_t SpiTransfer(DevHandle handle, struct SpiMsg *msgs, uint32_t count) in SpiTransfer() argument
48 return SpiCntlrTransfer(client->cntlr, client->csNum, msgs, count); in SpiTransfer()
/drivers/hdf_core/framework/support/platform/src/i3c/
Di3c_if.c25 int32_t I3cTransfer(DevHandle handle, struct I3cMsg *msgs, int16_t count, enum TransMode mode) in I3cTransfer() argument
34 if (msgs == NULL || count <= 0) { in I3cTransfer()
35 HDF_LOGE("I3cTransfer: err params! msgs:%s, count:%hd", (msgs == NULL) ? "0" : "x", count); in I3cTransfer()
41 ret = I3cCntlrI2cTransfer((struct I3cCntlr *)handle, msgs, count); in I3cTransfer()
44 ret = I3cCntlrTransfer((struct I3cCntlr *)handle, msgs, count); in I3cTransfer()
47 ret = I3cCntlrSendCccCmd((struct I3cCntlr *)handle, msgs->ccc); in I3cTransfer()
/drivers/hdf_core/adapter/khdf/linux/platform/i2c/
Di2c_adapter.c28 static struct i2c_msg *CreateLinuxI2cMsgs(struct I2cMsg *msgs, int16_t count) in CreateLinuxI2cMsgs() argument
40 linuxMsgs[i].addr = msgs[i].addr; in CreateLinuxI2cMsgs()
41 linuxMsgs[i].buf = msgs[i].buf; in CreateLinuxI2cMsgs()
42 linuxMsgs[i].len = msgs[i].len; in CreateLinuxI2cMsgs()
43 linuxMsgs[i].flags = msgs[i].flags; in CreateLinuxI2cMsgs()
48 static inline void FreeLinuxI2cMsgs(struct i2c_msg *msgs, int16_t count) in FreeLinuxI2cMsgs() argument
51 OsalMemFree(msgs); in FreeLinuxI2cMsgs()
54 static int32_t LinuxI2cTransfer(struct I2cCntlr *cntlr, struct I2cMsg *msgs, int16_t count) in LinuxI2cTransfer() argument
63 if (msgs == NULL || count <= 0) { in LinuxI2cTransfer()
68 linuxMsgs = CreateLinuxI2cMsgs(msgs, count); in LinuxI2cTransfer()
/drivers/hdf_core/framework/support/platform/include/i2c/
Di2c_msg.h17 int32_t I2cMsgsRebuildFromSbuf(struct HdfSBuf *data, struct I2cMsg **msgs, int16_t *count);
19 void I2cMsgsFree(struct I2cMsg *msgs, int16_t count);
21 int32_t I2cMsgsWriteToSbuf(struct I2cMsg *msgs, int16_t count, struct HdfSBuf *reply);
Di2c_core.h51 int32_t (*transfer)(struct I2cCntlr *cntlr, struct I2cMsg *msgs, int16_t count);
124 int32_t I2cCntlrTransfer(struct I2cCntlr *cntlr, struct I2cMsg *msgs, int16_t count);
/drivers/hdf_core/framework/model/audio/common/src/
Daudio_codec_base.c461 static void CodecI2cRelease(struct I2cMsg *msgs, int16_t msgSize, DevHandle i2cHandle) in CodecI2cRelease() argument
463 if (msgs != NULL) { in CodecI2cRelease()
464 if (msgSize == 0 && msgs->buf != NULL) { in CodecI2cRelease()
465 OsalMemFree(msgs->buf); in CodecI2cRelease()
466 msgs->buf = NULL; in CodecI2cRelease()
467 } else if (msgSize == 1 && msgs[0].buf != NULL) { in CodecI2cRelease()
468 OsalMemFree(msgs[0].buf); in CodecI2cRelease()
469 msgs[0].buf = NULL; in CodecI2cRelease()
471 if (msgs[0].buf != NULL) { in CodecI2cRelease()
472 OsalMemFree(msgs[0].buf); in CodecI2cRelease()
[all …]
/drivers/hdf_core/adapter/khdf/linux/test/platform/i2c/
Di2c_adapter_dummy.c30 static int32_t EchoI2cMsgs(struct I2cMsg *msgs, int16_t count) in EchoI2cMsgs() argument
38 msg = msgs + i; in EchoI2cMsgs()
55 static int32_t DummyI2cTransEcho(struct I2cCntlr *cntlr, struct I2cMsg *msgs, int16_t count) in DummyI2cTransEcho() argument
61 if (msgs == NULL || count <= 0) { in DummyI2cTransEcho()
66 return EchoI2cMsgs(msgs, count); in DummyI2cTransEcho()
/drivers/hdf_core/framework/test/unittest/platform/common/
Dspi_test.c275 struct SpiMsg msgs[SPI_TEST_MSG_NUM]; in SpiMultiTransferTest() local
280 msgs[SPI_TEST_MSG_0].rbuf = tester->config.rbuf; in SpiMultiTransferTest()
281 msgs[SPI_TEST_MSG_0].wbuf = tester->config.wbuf; in SpiMultiTransferTest()
282 msgs[SPI_TEST_MSG_0].len = tester->config.len; in SpiMultiTransferTest()
283 msgs[SPI_TEST_MSG_0].delayUs = 0; in SpiMultiTransferTest()
284 msgs[SPI_TEST_MSG_0].speed = 0; // use default speed in SpiMultiTransferTest()
286 msgs[SPI_TEST_MSG_1].wbuf = tester->config.wbuf; in SpiMultiTransferTest()
287 msgs[SPI_TEST_MSG_1].rbuf = NULL; in SpiMultiTransferTest()
288 msgs[SPI_TEST_MSG_1].len = tester->config.len; in SpiMultiTransferTest()
289 msgs[SPI_TEST_MSG_1].speed = 0; in SpiMultiTransferTest()
[all …]
Dmipi_dsi_test.c18 test->msgs.dataType = 0x05; /* 0x05: data type */ in MipiDsiTestMallocBuf()
19 test->msgs.dataLen = 1; /* 1: data len */ in MipiDsiTestMallocBuf()
20 test->msgs.delay = 0; in MipiDsiTestMallocBuf()
21 test->msgs.payload = &buf; in MipiDsiTestMallocBuf()
108 ret = MipiDsiTx(test->handle, &test->msgs); in MipiDsiTxRxTest()
Dmipi_dsi_test.h28 struct DsiCmdDesc msgs; member
/drivers/hdf_core/framework/test/unittest/platform/virtual/
Di3c_virtual.c35 struct I3cMsg *msgs; member
66 struct I3cMsg *msg = &td->msgs[td->index]; in VirtualI3cXferI2cOneMsgPolling()
88 static int32_t VirtualI3cTransfer(struct I3cCntlr *cntlr, struct I3cMsg *msgs, int16_t count) in VirtualI3cTransfer() argument
95 if (msgs == NULL || count <= 0) { in VirtualI3cTransfer()
103 static int32_t VirtualI3cCntlrI2cTransfer(struct I3cCntlr *cntlr, struct I3cMsg *msgs, int16_t coun… in VirtualI3cCntlrI2cTransfer() argument
116 if (msgs == NULL || count <= 0) { in VirtualI3cCntlrI2cTransfer()
120 td.msgs = msgs; in VirtualI3cCntlrI2cTransfer()
/drivers/hdf_core/framework/include/audio/
Daudio_dsp_if.h123 int32_t (*Read)(const struct DspDevice *dsp, const void *msgs, const uint32_t len);
137 int32_t (*Write)(const struct DspDevice *dsp, const void *msgs, const uint32_t len);
/drivers/hdf_core/framework/support/platform/include/i3c/
Di3c_core.h135 int32_t (*Transfer)(struct I3cCntlr *cntlr, struct I3cMsg *msgs, int16_t count);
149 int32_t (*i2cTransfer)(struct I3cCntlr *cntlr, struct I3cMsg *msgs, int16_t count);
309 int32_t I3cCntlrI2cTransfer(struct I3cCntlr *cntlr, struct I3cMsg *msgs, int16_t count);
323 int32_t I3cCntlrTransfer(struct I3cCntlr *cntlr, struct I3cMsg *msgs, int16_t count);
/drivers/hdf_core/adapter/platform/i2c/
Di2c_wm.c56 static int32_t i2cHostTransfer(struct I2cCntlr *cntlr, struct I2cMsg *msgs, int16_t count);
302 static int32_t i2c_transfer(struct I2cDevice *device, struct I2cMsg *msgs, int16_t count) in i2c_transfer() argument
307 if (device == NULL || msgs == NULL) { in i2c_transfer()
321 msg = &msgs[i]; in i2c_transfer()
328 static int32_t i2cHostTransfer(struct I2cCntlr *cntlr, struct I2cMsg *msgs, int16_t count) in i2cHostTransfer() argument
332 if (cntlr == NULL || msgs == NULL || cntlr->priv == NULL) { in i2cHostTransfer()
337 return i2c_transfer(device, msgs, count); in i2cHostTransfer()
Di2c_bes.c45 static int32_t i2cHostTransfer(struct I2cCntlr *cntlr, struct I2cMsg *msgs, int16_t count);
353 static int32_t i2c_transfer(struct I2cDevice *device, struct I2cMsg *msgs, int16_t count) in i2c_transfer() argument
359 if (device == NULL || msgs == NULL) { in i2c_transfer()
374 msg = &msgs[i]; in i2c_transfer()
384 msg2 = &msgs[i]; in i2c_transfer()
404 static int32_t i2cHostTransfer(struct I2cCntlr *cntlr, struct I2cMsg *msgs, int16_t count) in i2cHostTransfer() argument
408 if (cntlr == NULL || msgs == NULL || cntlr->priv == NULL) { in i2cHostTransfer()
413 return i2c_transfer(device, msgs, count); in i2cHostTransfer()
/drivers/hdf_core/framework/support/platform/src/fwk/
Dplatform_queue.c34 if (DListIsEmpty(&queue->msgs)) { in PlatformQueueNextMsg()
38 *msg = DLIST_FIRST_ENTRY(&queue->msgs, struct PlatformMsg, node); in PlatformQueueNextMsg()
88 DListHeadInit(&queue->msgs); in PlatformQueueCreate()
165 DListInsertTail(&msg->node, &queue->msgs); in PlatformQueueAddMsg()
/drivers/hdf_core/adapter/khdf/liteos/platform/include/
Di2c_dev.h73 struct i2c_msg *msgs; member
/drivers/hdf_core/framework/include/platform/
Di2c_if.h139 int32_t I2cTransfer(DevHandle handle, struct I2cMsg *msgs, int16_t count);
/drivers/hdf_core/framework/support/platform/include/fwk/
Dplatform_queue.h39 struct DListHead msgs; member

12