diff --git a/manager/Makefile b/manager/Makefile index 40df479416e57be60b7cdc8f036ed7095a983374..fb189780014881aee2a8525e8c86a8f3d61f9fca 100644 --- a/manager/Makefile +++ b/manager/Makefile @@ -27,6 +27,7 @@ obj-y += \ $(HDF_FRAMEWORK_SRC_DIR)/framework/utils/src/hdf_map.o \ $(HDF_FRAMEWORK_SRC_DIR)/framework/utils/src/hdf_sbuf.o \ $(HDF_FRAMEWORK_SRC_DIR)/framework/utils/src/hdf_sbuf_impl_raw.o \ + $(HDF_FRAMEWORK_SRC_DIR)/framework/utils/src/hdf_task_queue.o \ $(HDF_FRAMEWORK_SRC_DIR)/framework/core/host/src/devhost_service.o \ $(HDF_FRAMEWORK_SRC_DIR)/framework/core/host/src/devmgr_service_clnt.o \ $(HDF_FRAMEWORK_SRC_DIR)/framework/core/host/src/devsvc_manager_clnt.o \ @@ -37,6 +38,7 @@ obj-y += \ $(HDF_FRAMEWORK_SRC_DIR)/framework/core/host/src/hdf_observer_record.o \ $(HDF_FRAMEWORK_SRC_DIR)/framework/core/host/src/hdf_service_subscriber.o \ $(HDF_FRAMEWORK_SRC_DIR)/framework/core/host/src/hdf_device_object.o \ + $(HDF_FRAMEWORK_SRC_DIR)/framework/core/host/src/hdf_power_manager.o \ $(HDF_FRAMEWORK_SRC_DIR)/framework/core/host/src/hdf_service_observer.o \ $(HDF_FRAMEWORK_SRC_DIR)/framework/core/host/src/power_state_token.o \ $(HDF_FRAMEWORK_SRC_DIR)/framework/core/manager/src/devhost_service_clnt.o \ diff --git a/manager/src/devmgr_pm_reg.c b/manager/src/devmgr_pm_reg.c index fc92e37895d95ec8e8500e05fb0e3c16244a89ef..ae8da991e38c3feb5766415473efd64d6478bc2d 100755 --- a/manager/src/devmgr_pm_reg.c +++ b/manager/src/devmgr_pm_reg.c @@ -22,7 +22,6 @@ #include "hdf_base.h" #include "hdf_log.h" -#define HDF_MODULE_NAME "devmgr_pm" #define HDF_LOG_TAG devmgr_pm static int DevmgrPmSuspend(void) diff --git a/model/audio/Kconfig b/model/audio/Kconfig index efb17c9560c5358e235e70470eed92f567ccbc86..b195ba7140be70b4145eef2e0016d5b227e9eac2 100755 --- a/model/audio/Kconfig +++ b/model/audio/Kconfig @@ -4,9 +4,9 @@ config DRIVERS_HDF_AUDIO depends on DRIVERS_HDF help Answer Y to choice HDF Audio driver. -config DRIVERS_HDF_AUDIO_HI3516CODEC +config DRIVERS_HDF_AUDIO_RK3399 bool "Enable HDF Audio Codec driver" - default n + default y depends on DRIVERS_HDF_AUDIO help Answer Y to choice HDF Audio Codec driver. diff --git a/model/audio/Makefile b/model/audio/Makefile index d66037684d804b206980fcc6a8a2ba235f8be742..cd884dc2ac0a2dd3d34e615ea58979e627cfb4d3 100755 --- a/model/audio/Makefile +++ b/model/audio/Makefile @@ -16,8 +16,8 @@ KHDF_AUDIO_BASE_ROOT_DIR = ../../../../../.. KHDF_AUDIO_KHDF_ROOT_DIR = drivers/hdf/khdf KHDF_FRAMEWORK_ROOT_DIR = drivers/hdf/framework KHDF_AUDIO_ROOT_DIR = ../../../../../framework/model/audio -KHDF_AUDIO_HI3516DV300_DIR = $(KHDF_AUDIO_BASE_ROOT_DIR)/drivers/peripheral/audio/chipsets/hi3516dv300 -KHDF_AUDIO_HI3516DV300_INC_DIR = drivers/hdf/framework/../peripheral/audio/chipsets/hi3516dv300 +KHDF_AUDIO_RK3399_DIR = $(KHDF_AUDIO_BASE_ROOT_DIR)/drivers/peripheral/audio/chipsets/rk3399 +KHDF_AUDIO_RK3399_INC_DIR = drivers/hdf/framework/../peripheral/audio/chipsets/rk3399 obj-$(CONFIG_DRIVERS_HDF_AUDIO) += \ $(KHDF_AUDIO_ROOT_DIR)/core/src/audio_core.o \ @@ -33,19 +33,13 @@ obj-$(CONFIG_DRIVERS_HDF_AUDIO) += \ $(KHDF_AUDIO_ROOT_DIR)/dispatch/src/audio_stream_dispatch.o \ $(KHDF_AUDIO_ROOT_DIR)/dispatch/src/audio_control_dispatch.o -obj-$(CONFIG_DRIVERS_HDF_AUDIO_HI3516CODEC) += \ - $(KHDF_AUDIO_HI3516DV300_DIR)/../tfa9879/accessory/src/tfa9879_accessory_adapter.o \ - $(KHDF_AUDIO_HI3516DV300_DIR)/../tfa9879/accessory/src/tfa9879_accessory_impl.o \ - $(KHDF_AUDIO_HI3516DV300_DIR)/codec/src/hi3516_codec_adapter.o \ - $(KHDF_AUDIO_HI3516DV300_DIR)/codec/src/hi3516_codec_impl.o \ - $(KHDF_AUDIO_HI3516DV300_DIR)/codec/src/hi3516_codec_ops.o \ - $(KHDF_AUDIO_HI3516DV300_DIR)/dsp/src/dsp_adapter.o \ - $(KHDF_AUDIO_HI3516DV300_DIR)/dsp/src/dsp_ops.o \ - $(KHDF_AUDIO_HI3516DV300_DIR)/soc/src/hi3516_dai_adapter.o \ - $(KHDF_AUDIO_HI3516DV300_DIR)/soc/src/hi3516_dai_ops.o \ - $(KHDF_AUDIO_HI3516DV300_DIR)/soc/src/hi3516_aiao_impl.o \ - $(KHDF_AUDIO_HI3516DV300_DIR)/soc/src/hi3516_dma_ops.o \ - $(KHDF_AUDIO_HI3516DV300_DIR)/soc/src/hi3516_dma_adapter.o +obj-$(CONFIG_DRIVERS_HDF_AUDIO_RK3399) += \ + $(KHDF_AUDIO_RK3399_DIR)/soc/src/rk3399_dma_ops.o \ + $(KHDF_AUDIO_RK3399_DIR)/soc/src/rk3399_dma_adapter.o \ + $(KHDF_AUDIO_RK3399_DIR)/dai/src/rk3399_dai_adapter.o \ + $(KHDF_AUDIO_RK3399_DIR)/dai/src/rk3399_dai_ops.o \ + $(KHDF_AUDIO_RK3399_DIR)/accessory/es8316/src/es8316_accessory_adapter.o \ + $(KHDF_AUDIO_RK3399_DIR)/accessory/es8316/src/es8316_accessory_impl.o ccflags-$(CONFIG_DRIVERS_HDF_AUDIO) += -lm -lc -lgcc -std=gnu99 -Werror \ -I$(srctree)/$(KHDF_AUDIO_KHDF_ROOT_DIR)/osal/include \ @@ -63,8 +57,8 @@ ccflags-$(CONFIG_DRIVERS_HDF_AUDIO) += -lm -lc -lgcc -std=gnu99 -Werror \ -I$(srctree)/$(KHDF_FRAMEWORK_ROOT_DIR)/model/audio/common/include \ -I$(srctree)/bounds_checking_function/include -ccflags-$(CONFIG_DRIVERS_HDF_AUDIO_HI3516CODEC) += \ - -I$(srctree)/$(KHDF_AUDIO_HI3516DV300_INC_DIR)/codec/include \ - -I$(srctree)/$(KHDF_AUDIO_HI3516DV300_INC_DIR)/soc/include \ - -I$(srctree)/$(KHDF_AUDIO_HI3516DV300_INC_DIR)/dsp/include \ - -I$(srctree)/$(KHDF_AUDIO_HI3516DV300_INC_DIR)/../tfa9879/accessory/include +ccflags-$(CONFIG_DRIVERS_HDF_AUDIO_RK3399) += -lm -lc -lgcc -std=gnu99 -Werror \ + -I$(srctree)/$(KHDF_AUDIO_RK3399_INC_DIR)/soc/include \ + -I$(srctree)/$(KHDF_AUDIO_RK3399_INC_DIR)/dai/include \ + -I$(srctree)/$(KHDF_AUDIO_RK3399_INC_DIR)/accessory/es8316/include + diff --git a/model/sensor/Kconfig b/model/sensor/Kconfig index c8d1b9957f834beba0a8c8b59626bbb77862e09f..27bc18b197b3b173c806fc7a0c65635af64b7111 100644 --- a/model/sensor/Kconfig +++ b/model/sensor/Kconfig @@ -40,6 +40,12 @@ config DRIVERS_HDF_SENSOR_ALS_BH1745 depends on DRIVERS_HDF_SENSOR_ALS help Answer Y to enable HDF als bh1745 sensor driver. +config DRIVERS_HDF_SENSOR_GRAVITY + bool "Enable HDF gravity sensor driver" + default n + depends on DRIVERS_HDF_SENSOR_ACCEL + help + Answer Y to enable HDF gravity sensor driver. config DRIVERS_HDF_SENSOR_GYRO bool "Enable HDF gyro sensor driver" default n diff --git a/model/sensor/Makefile b/model/sensor/Makefile index 438c60ade53ed34d1d6c631fda580280519b11fa..ee3d5070bf5c3d0cb9b58d2f7d34c692f0cf7ada 100644 --- a/model/sensor/Makefile +++ b/model/sensor/Makefile @@ -46,6 +46,8 @@ obj-$(CONFIG_DRIVERS_HDF_SENSOR_MAGNETIC) += $(SENSOR_ROOT_DIR)/magnetic/sensor_ obj-$(CONFIG_DRIVERS_HDF_SENSOR_MAGNETIC_LSM303) += $(SENSOR_ROOT_DIR)/chipset/magnetic/magnetic_lsm303.o +obj-$(CONFIG_DRIVERS_HDF_SENSOR_GRAVITY) += $(SENSOR_ROOT_DIR)/accel/sensor_gravity_driver.o + ccflags-y += -I$(srctree)/drivers/hdf/framework/model/sensor/driver/include \ -I$(srctree)/drivers/hdf/framework/model/sensor/driver/common/include \ -I$(srctree)/drivers/hdf/framework/model/sensor/driver/chipset/accel \ diff --git a/model/usb/host/src/usb_pnp_notify.c b/model/usb/host/src/usb_pnp_notify.c index 2d86d816cae357553213e299f21741503863e23a..a7896dc3b25c7bd133525eaf4d613aec6c1a161c 100755 --- a/model/usb/host/src/usb_pnp_notify.c +++ b/model/usb/host/src/usb_pnp_notify.c @@ -27,12 +27,23 @@ #include "securec.h" #define HDF_LOG_TAG USB_PNP_NOTIFY +#ifndef USB_GADGET_ADD +#define USB_GADGET_ADD 0x0005 +#endif +#ifndef USB_GADGET_REMOVE +#define USB_GADGET_REMOVE 0x0006 +#endif static wait_queue_head_t g_usbPnpNotifyReportWait; +static wait_queue_head_t g_gadgetPnpNotifyReportWait; static struct task_struct *g_usbPnpNotifyReportThread = NULL; +static struct task_struct *g_gadgetPnpNotifyReportThread = NULL; static enum UsbPnpNotifyServiceCmd g_usbPnpNotifyCmdType = USB_PNP_NOTIFY_ADD_INTERFACE; static enum UsbPnpNotifyRemoveType g_usbPnpNotifyRemoveType = USB_PNP_NOTIFY_REMOVE_BUS_DEV_NUM; +static uint8_t g_gadgetPnpNotifyType = 0; +static unsigned long g_preAcion = 0; struct OsalMutex g_usbSendEventLock; +struct OsalMutex g_gadgetSendEventLock; struct usb_device *g_usbDevice = NULL; struct UsbPnpAddRemoveInfo g_usbPnpInfo; struct DListHead g_usbPnpInfoListHead; @@ -158,7 +169,7 @@ static int32_t UsbPnpNotifyAddInitInfo(struct UsbPnpDeviceInfo *deviceInfo, unio if (infoData.usbDev->bus == NULL) { HDF_LOGE("%s infoData.usbDev->bus=%px is NULL", __func__, infoData.usbDev->bus); ret = HDF_ERR_INVALID_PARAM; - goto out; + goto OUT; } deviceInfo->info.busNum = infoData.usbDev->bus->busnum; @@ -173,7 +184,7 @@ static int32_t UsbPnpNotifyAddInitInfo(struct UsbPnpDeviceInfo *deviceInfo, unio if (infoData.usbDev->actconfig == NULL) { HDF_LOGE("%s infoData.usbDev->actconfig=%p is NULL", __func__, infoData.usbDev->actconfig); ret = HDF_ERR_INVALID_PARAM; - goto out; + goto OUT; } deviceInfo->info.numInfos = infoData.usbDev->actconfig->desc.bNumInterfaces; for (uint8_t i = 0; i < deviceInfo->info.numInfos; i++) { @@ -183,7 +194,7 @@ static int32_t UsbPnpNotifyAddInitInfo(struct UsbPnpDeviceInfo *deviceInfo, unio __func__, i, infoData.usbDev->actconfig->interface[i], i, infoData.usbDev->actconfig->interface[i]->cur_altsetting); ret = HDF_ERR_INVALID_PARAM; - goto out; + goto OUT; } deviceInfo->info.interfaceInfo[i].interfaceClass = infoData.usbDev->actconfig->interface[i]->cur_altsetting->desc.bInterfaceClass; @@ -201,7 +212,7 @@ static int32_t UsbPnpNotifyAddInitInfo(struct UsbPnpDeviceInfo *deviceInfo, unio deviceInfo->info.interfaceInfo[i].interfaceNumber); } -out: +OUT: return ret; } @@ -243,10 +254,10 @@ static void UsbPnpNotifyAddInterfaceInitInfo(struct UsbPnpDeviceInfo *deviceInfo j++; HDF_LOGI("%s:%d i=%d, j=%d, interfaceInfo=0x%x-0x%x-0x%x-0x%x", - __func__, __LINE__, i, j-1, infoTable->interfaceInfo[j-1].interfaceClass, - infoTable->interfaceInfo[j-1].interfaceSubClass, - infoTable->interfaceInfo[j-1].interfaceProtocol, - infoTable->interfaceInfo[j-1].interfaceNumber); + __func__, __LINE__, i, j - 1, infoTable->interfaceInfo[j - 1].interfaceClass, + infoTable->interfaceInfo[j - 1].interfaceSubClass, + infoTable->interfaceInfo[j - 1].interfaceProtocol, + infoTable->interfaceInfo[j - 1].interfaceNumber); } infoTable->numInfos = j; } @@ -280,7 +291,7 @@ static int32_t UsbPnpNotifyInitInfo( } else if (g_usbPnpNotifyCmdType == USB_PNP_NOTIFY_REPORT_INTERFACE) { ret = UsbPnpNotifyAddInitInfo(deviceInfo, infoData); if (ret != HDF_SUCCESS) { - goto out; + goto OUT; } data = (const void *)(&deviceInfo->info); @@ -291,10 +302,10 @@ static int32_t UsbPnpNotifyInitInfo( if (!HdfSbufWriteBuffer(sbuf, data, sizeof(struct UsbPnpNotifyMatchInfoTable))) { HDF_LOGE("%s:%d sbuf write data failed", __func__, __LINE__); ret = HDF_FAILURE; - goto out; + goto OUT; } -out: +OUT: return ret; } @@ -357,13 +368,13 @@ static int32_t UsbPnpNotifyHdfSendEvent(const struct HdfDeviceObject *deviceObje ret = UsbPnpNotifyGetDeviceInfo(eventData, &pnpInfoData, &deviceInfo); if (ret != HDF_SUCCESS) { HDF_LOGE("%s:%d UsbPnpNotifyGetDeviceInfo failed, ret=%d", __func__, __LINE__, ret); - goto error_device_info; + goto ERROR_DEVICE_INFO; } ret = UsbPnpNotifyInitInfo(data, deviceInfo, pnpInfoData); if (ret != HDF_SUCCESS) { HDF_LOGE("%s:%d UsbPnpNotifyInitInfo failed, ret=%d", __func__, __LINE__, ret); - goto out; + goto OUT; } HDF_LOGI("%s:%d report one device information, %d usbDevAddr=0x%x, devNum=%d, busNum=%d, infoTable=%d-0x%x-0x%x!", @@ -377,7 +388,7 @@ static int32_t UsbPnpNotifyHdfSendEvent(const struct HdfDeviceObject *deviceObje if (ret != HDF_SUCCESS) { OsalMutexUnlock(&deviceInfo->lock); HDF_LOGE("%s:%d HdfDeviceSendEvent ret=%d", __func__, __LINE__, ret); - goto out; + goto OUT; } deviceInfo->status = USB_PNP_DEVICE_ADD_STATUS; } else { @@ -385,13 +396,13 @@ static int32_t UsbPnpNotifyHdfSendEvent(const struct HdfDeviceObject *deviceObje } OsalMutexUnlock(&deviceInfo->lock); -out: +OUT: if ((ret != HDF_SUCCESS) || (g_usbPnpNotifyCmdType == USB_PNP_NOTIFY_REMOVE_DEVICE)) { if (UsbPnpNotifyDestroyInfo(deviceInfo) != HDF_SUCCESS) { HDF_LOGE("%s:%d UsbPnpNotifyDestroyInfo fail", __func__, __LINE__); } } -error_device_info: +ERROR_DEVICE_INFO: HdfSBufRecycle(data); return ret; } @@ -447,7 +458,6 @@ static void TestPnpNotifyFillInfoTable(struct UsbPnpNotifyMatchInfoTable *infoTa static int32_t TestPnpNotifyHdfSendEvent(const struct HdfDeviceObject *deviceObject) { - int32_t ret; struct UsbPnpNotifyMatchInfoTable infoTable; struct HdfSBuf *data = NULL; @@ -466,28 +476,55 @@ static int32_t TestPnpNotifyHdfSendEvent(const struct HdfDeviceObject *deviceObj if (!HdfSbufWriteBuffer(data, (const void *)(&infoTable), sizeof(struct UsbPnpNotifyMatchInfoTable))) { HDF_LOGE("%s: sbuf write infoTable failed", __func__); - goto out; + goto OUT; } HDF_LOGI("%s: report one device information, %d usbDev=0x%x, devNum=%d, busNum=%d, infoTable=%d-0x%x-0x%x!", \ __func__, g_usbPnpNotifyCmdType, (uint32_t)infoTable.usbDevAddr, infoTable.devNum, infoTable.busNum, \ infoTable.numInfos, infoTable.deviceInfo.vendorId, infoTable.deviceInfo.productId); - ret = HdfDeviceSendEvent(deviceObject, g_usbPnpNotifyCmdType, data); + int32_t ret = HdfDeviceSendEvent(deviceObject, g_usbPnpNotifyCmdType, data); if (ret != HDF_SUCCESS) { HDF_LOGE("%s: HdfDeviceSendEvent error=%d", __func__, ret); - goto out; + goto OUT; } HdfSBufRecycle(data); return ret; -out: +OUT: HdfSBufRecycle(data); return HDF_FAILURE; } #endif +static int32_t GadgetPnpNotifyHdfSendEvent(const struct HdfDeviceObject *deviceObject) +{ + if (deviceObject == NULL) { + HDF_LOGE("%s deviceObject=%p", __func__, deviceObject); + return HDF_ERR_INVALID_PARAM; + } + + struct HdfSBuf *data = NULL; + data = HdfSBufObtainDefaultSize(); + if (data == NULL) { + HDF_LOGE("%s:%d InitDataBlock failed", __func__, __LINE__); + return HDF_FAILURE; + } + if (!HdfSbufWriteUint8(data, g_gadgetPnpNotifyType)) { + HDF_LOGE("%s, UsbEcmRead HdfSbufWriteInt8 error", __func__); + HdfSBufRecycle(data); + return HDF_FAILURE; + } + int32_t ret = HdfDeviceSendEvent(deviceObject, g_gadgetPnpNotifyType, data); + if (ret != HDF_SUCCESS) { + HDF_LOGE("%s:%d HdfDeviceSendEvent ret=%d", __func__, __LINE__, ret); + } + + HdfSBufRecycle(data); + return ret; +} + static int UsbPnpNotifyFirstReport(struct usb_device *usbDev, void *data) { int ret; @@ -550,6 +587,32 @@ static int UsbPnpNotifyReportThread(void* arg) return 0; } +static int GadgetPnpNotifyReportThread(void* arg) +{ + int ret; + struct HdfDeviceObject *deviceObject = (struct HdfDeviceObject *)arg; + + while (!kthread_should_stop()) { + ret = wait_event_interruptible(g_gadgetPnpNotifyReportWait, + (g_gadgetPnpNotifyType != 0)); + if (!ret) { + HDF_LOGI("%s: GadgetPnpNotifyReportThread start!", __func__); + } + OsalMutexLock(&g_gadgetSendEventLock); + ret = GadgetPnpNotifyHdfSendEvent(deviceObject); + if (ret != HDF_SUCCESS) { + HDF_LOGI("%s: UsbPnpNotifyHdfSendEvent error=%d!", __func__, ret); + } + g_gadgetPnpNotifyType = 0; + OsalMutexUnlock(&g_gadgetSendEventLock); + msleep(USB_PNP_NOTIFY_MSLEEP_TIME); + } + + HDF_LOGI("%s: gadget pnp notify handle kthread exiting!", __func__); + + return 0; +} + static int UsbPnpNotifyCallback(struct notifier_block *self, unsigned long action, void *dev) { int32_t ret; @@ -600,6 +663,23 @@ static int UsbPnpNotifyCallback(struct notifier_block *self, unsigned long actio wake_up_interruptible(&g_usbPnpNotifyReportWait); } break; + case USB_GADGET_ADD: + case USB_GADGET_REMOVE: + OsalMutexLock(&g_gadgetSendEventLock); + if (g_preAcion == action) { + OsalMutexUnlock(&g_gadgetSendEventLock); + break; + } + if (action == USB_GADGET_ADD) { + g_gadgetPnpNotifyType = USB_PNP_DRIVER_GADGET_ADD; + } else { + g_gadgetPnpNotifyType = USB_PNP_DRIVER_GADGET_REMOVE; + } + OsalMutexUnlock(&g_gadgetSendEventLock); + HDF_LOGI("%s:%d g_gadgetPnpNotifyType = %d", __func__, __LINE__, g_gadgetPnpNotifyType); + wake_up_interruptible(&g_gadgetPnpNotifyReportWait); + g_preAcion = action; + break; default: HDF_LOGI("%s: the action = 0x%lx is not defined!", __func__, action); break; @@ -658,6 +738,38 @@ static void UsbPnpNotifyReadPnpInfo(struct HdfSBuf *data) g_usbPnpInfo.interfaceProtocol); } +static int32_t UsbPnpGetDevices(struct HdfSBuf *reply) +{ + int32_t ret = HDF_SUCCESS; + struct UsbPnpDeviceInfo *infoPos = NULL; + struct UsbPnpDeviceInfo *infoTemp = NULL; + + if (DListIsEmpty(&g_usbPnpInfoListHead)) { + return ret; + } + DLIST_FOR_EACH_ENTRY_SAFE(infoPos, infoTemp, &g_usbPnpInfoListHead, struct UsbPnpDeviceInfo, list){ + if (!HdfSbufWriteInt32(reply, infoPos->info.busNum)) { + break; + } + if (!HdfSbufWriteInt32(reply, infoPos->info.devNum)) { + break; + } + if (!HdfSbufWriteUint8(reply, infoPos->info.deviceInfo.deviceClass)) { + break; + } + if (!HdfSbufWriteUint8(reply, infoPos->info.deviceInfo.deviceSubClass)) { + break; + } + if (!HdfSbufWriteUint8(reply, infoPos->info.deviceInfo.deviceProtocol)) { + break; + } + if (!HdfSbufWriteUint8(reply, infoPos->status)) { + break; + } + } + return ret; +} + static int32_t UsbPnpNotifyDispatch(struct HdfDeviceIoClient *client, int cmd, struct HdfSBuf *data, struct HdfSBuf *reply) { @@ -666,7 +778,9 @@ static int32_t UsbPnpNotifyDispatch(struct HdfDeviceIoClient *client, int cmd, HDF_LOGI("%s: received cmd = %d", __func__, cmd); OsalMutexLock(&g_usbSendEventLock); - g_usbPnpNotifyCmdType = cmd; + if (USB_PNP_DRIVER_GETDEVICES != cmd) { + g_usbPnpNotifyCmdType = cmd; + } switch (cmd) { case USB_PNP_NOTIFY_ADD_INTERFACE: @@ -692,6 +806,9 @@ static int32_t UsbPnpNotifyDispatch(struct HdfDeviceIoClient *client, int cmd, wake_up_interruptible(&g_usbPnpNotifyReportWait); break; #endif + case USB_PNP_DRIVER_GETDEVICES: + UsbPnpGetDevices(reply); + break; default: ret = HDF_ERR_NOT_SUPPORT; break; @@ -741,8 +858,10 @@ static int32_t UsbPnpNotifyInit(struct HdfDeviceObject *device) } init_waitqueue_head(&g_usbPnpNotifyReportWait); + init_waitqueue_head(&g_gadgetPnpNotifyReportWait); OsalMutexInit(&g_usbSendEventLock); + OsalMutexInit(&g_gadgetSendEventLock); /* Add a new notify for usb pnp notify module. */ usb_register_notify(&g_usbPnpNotifyNb); @@ -751,10 +870,24 @@ static int32_t UsbPnpNotifyInit(struct HdfDeviceObject *device) if (NULL == g_usbPnpNotifyReportThread) { g_usbPnpNotifyReportThread = kthread_run(UsbPnpNotifyReportThread, (void *)device, "usb pnp notify handle kthread"); + if (g_usbPnpNotifyReportThread == NULL) { + HDF_LOGE("%s: kthread_run g_usbPnpNotifyReportThread is NULL", __func__); + } } else { HDF_LOGI("%s: g_usbPnpNotifyReportThread is already running!", __func__); } + /* Creat thread to handle gadeget information. */ + if (NULL == g_gadgetPnpNotifyReportThread) { + g_gadgetPnpNotifyReportThread = kthread_run(GadgetPnpNotifyReportThread, + (void *)device, "gadget pnp notify handle kthread"); + if (g_usbPnpNotifyReportThread == NULL) { + HDF_LOGE("%s: kthread_run g_usbPnpNotifyReportThread is NULL", __func__); + } + } else { + HDF_LOGI("%s: g_devPnpNotifyReportThread is already running!", __func__); + } + return HDF_SUCCESS; } @@ -770,10 +903,16 @@ static void UsbPnpNotifyRelease(struct HdfDeviceObject *device) } else { kthread_stop(g_usbPnpNotifyReportThread); } + if (g_gadgetPnpNotifyReportThread == NULL) { + HDF_LOGI("%s: g_usbPnpNotifyReportThread is not running!", __func__); + } else { + kthread_stop(g_gadgetPnpNotifyReportThread); + } usb_unregister_notify(&g_usbPnpNotifyNb); OsalMutexDestroy(&g_usbSendEventLock); + OsalMutexDestroy(&g_gadgetSendEventLock); HDF_LOGI("%s: release done!", __func__); diff --git a/platform/mipi_csi/Makefile b/platform/mipi_csi/Makefile index df9b27237dea1c08cb31b809be7994d2d131e389..be5b690d26fb3419dd79821892acf4de88336190 100755 --- a/platform/mipi_csi/Makefile +++ b/platform/mipi_csi/Makefile @@ -16,6 +16,7 @@ include drivers/hdf/khdf/platform/platform.mk obj-y += $(HDF_PLATFORM_FRAMEWORKS_ROOT)/src/mipi/mipi_csi_core.o \ $(HDF_PLATFORM_FRAMEWORKS_ROOT)/src/mipi/mipi_csi_if.o +obj-$(CONFIG_VIDEO_V4L2) += mipi_v4l2_adapter.o obj-y += mipi_csi_dev.o \ diff --git a/platform/mipi_csi/mipi_v4l2_adapter.c b/platform/mipi_csi/mipi_v4l2_adapter.c new file mode 100755 index 0000000000000000000000000000000000000000..aa7802852acf53ca8caef38f52f31ec18f73783a --- /dev/null +++ b/platform/mipi_csi/mipi_v4l2_adapter.c @@ -0,0 +1,506 @@ +/* + * mipi_v4l2_adapter.c + * + * Mipi v4l2 adapter driver. + * + * Copyright (c) 2021 Huawei Device Co., Ltd. + * + * This software is licensed under the terms of the GNU General Public + * License version 2, as published by the Free Software Foundation, and + * may be copied, distributed, and modified under those terms. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include "hdf_log.h" +#include "mipi_csi_core.h" + +#define HDF_LOG_TAG mipi_v4l2_adapter +#define SENSOR_FLL_MAX 0xffff + +/* Mode : resolution and related config&values */ +struct CameraSensorMode { + /* V-timing */ + u32 fll_def; + u32 fll_min; + + /* H-timing */ + u32 llp; +}; + +struct CameraDrvData { + struct v4l2_subdev *sd; + struct media_pad *pad; + + /* V4L2 Controls */ + struct v4l2_ctrl_handler *ctrl_handler; + struct v4l2_ctrl *link_freq; + struct v4l2_ctrl *pixel_rate; + struct v4l2_ctrl *vblank; + struct v4l2_ctrl *hblank; + struct v4l2_ctrl *exposure; + struct v4l2_ctrl *vflip; + struct v4l2_ctrl *hflip; + + /* Current mode */ + const struct CameraSensorMode *cur_mode; + s64 link_freqs; /* CSI-2 link frequencies, Application under v4l2 framework */ + + /* Streaming on/off */ + bool streaming; +}; + +struct AdapterDrvData { + struct CameraDrvData *camera; + ComboDevAttr *attr; + + struct v4l2_subdev_format fmt; + /* + * Mutex for serialized access: + * Protect sensor set pad format and start/stop streaming safely. + * Protect access to sensor v4l2 controls. + */ + struct mutex mutex; +}; + +static struct AdapterDrvData g_adapterDrvData; + +/** + * Get bayer order based on flip setting. + * ref. linuxtv.org/downloads/v4l-dvb-apis/userspace-api/v4l/subdev-formats.html?highlight=media_bus_fmt_uv8_1x8 + */ +static u32 LinuxGetFormatCode(DataType dataType) +{ + u32 code = MEDIA_BUS_FMT_SGBRG12_1X12;; + + switch(dataType){ + case DATA_TYPE_RAW_8BIT: + code = MEDIA_BUS_FMT_SBGGR8_1X8; + break; + case DATA_TYPE_RAW_10BIT: + code = MEDIA_BUS_FMT_SBGGR10_1X10; + break; + case DATA_TYPE_RAW_12BIT: + code = MEDIA_BUS_FMT_SBGGR12_1X12; + break; + case DATA_TYPE_RAW_14BIT: + code = MEDIA_BUS_FMT_SBGGR14_1X14; + break; + case DATA_TYPE_RAW_16BIT: + code = MEDIA_BUS_FMT_SBGGR16_1X16; + break; + case DATA_TYPE_YUV420_8BIT_NORMAL: + code = MEDIA_BUS_FMT_Y8_1X8; + break; + case DATA_TYPE_YUV420_8BIT_LEGACY: + code = MEDIA_BUS_FMT_Y8_1X8; + break; + case DATA_TYPE_YUV422_8BIT: + code = MEDIA_BUS_FMT_YUYV8_1X16; + break; + case DATA_TYPE_YUV422_PACKED: + code = MEDIA_BUS_FMT_YVYU8_1X16; + break; + default: + break; + } + + return code; +} + +static int LinuxEnumMbusCode(struct v4l2_subdev *sd, + struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_mbus_code_enum *code) +{ + struct AdapterDrvData *drvData = &g_adapterDrvData; + (void)sd; + (void)cfg; + + if (code == NULL) { + HDF_LOGE("%s: code is NULL.", __func__); + return -EINVAL; + } + if (code->index > 0) { + HDF_LOGE("%s: code->index is invalid.", __func__); + return -EINVAL; + } + + mutex_lock(&drvData->mutex); + code->code = drvData->fmt.format.code; + mutex_unlock(&drvData->mutex); + + return 0; +} + +static void LinuxUpdatePadFormat(struct AdapterDrvData *drvData, + const struct CameraSensorMode *mode, struct v4l2_subdev_format *fmt) +{ + (void)mode; + + if ((drvData == NULL) || (fmt == NULL)) { + HDF_LOGE("%s: drvData or fmt is NULL.", __func__); + return; + } + fmt->format = drvData->fmt.format; +} + +static int LinuxSetPadFormat(struct v4l2_subdev *sd, struct v4l2_subdev_pad_config *cfg, + struct v4l2_subdev_format *fmt) +{ + s32 vblank_def; + s32 vblank_min; + s64 h_blank; + u64 pixel_rate; + u32 height; + struct AdapterDrvData *drvData = &g_adapterDrvData; + struct CameraDrvData *camera = drvData->camera; + const struct CameraSensorMode *mode = camera->cur_mode; + ImgRect *rect = &drvData->attr->imgRect; + + (void)sd; + (void)cfg; + mutex_lock(&drvData->mutex); + /* + * Only one bayer order is supported. + * It depends on the flip settings. + */ + fmt->format.code = drvData->fmt.format.code; + LinuxUpdatePadFormat(drvData, mode, fmt); + + pixel_rate = camera->link_freqs * 2 * 4; + do_div(pixel_rate, 10); + __v4l2_ctrl_s_ctrl_int64(camera->pixel_rate, pixel_rate); + /* Update limits and set FPS to default */ + height = rect->height; + vblank_def = camera->cur_mode->fll_def - height; + vblank_min = camera->cur_mode->fll_min - height; + height = SENSOR_FLL_MAX - height; + __v4l2_ctrl_modify_range(camera->vblank, vblank_min, height, 1, vblank_def); + __v4l2_ctrl_s_ctrl(camera->vblank, vblank_def); + h_blank = mode->llp - rect->width; + /* + * Currently hblank is not changeable. + * So FPS control is done only by vblank. + */ + __v4l2_ctrl_modify_range(camera->hblank, h_blank, h_blank, 1, h_blank); + mutex_unlock(&drvData->mutex); + + return 0; +} + +static int SetStream(int enable) +{ + struct AdapterDrvData *drvData = &g_adapterDrvData; + struct CameraDrvData *camera = drvData->camera; + + mutex_lock(&drvData->mutex); + if (camera->streaming == enable) { + mutex_unlock(&drvData->mutex); + HDF_LOGE("%s: streaming-flag is not change.", __func__); + return 0; + } + + camera->streaming = enable; + + /* vflip and hflip cannot change during streaming */ + __v4l2_ctrl_grab(camera->vflip, enable); + __v4l2_ctrl_grab(camera->hflip, enable); + mutex_unlock(&drvData->mutex); + + return 0; +} + +static const struct v4l2_subdev_video_ops g_cameraVideoOps = { + .s_stream = NULL, +}; + +static const struct v4l2_subdev_pad_ops g_cameraPadOps = { + .enum_mbus_code = LinuxEnumMbusCode, + .set_fmt = LinuxSetPadFormat, +}; + +static const struct v4l2_subdev_ops g_cameraSubdevOps = { + .video = &g_cameraVideoOps, + .pad = &g_cameraPadOps, +}; + +/* Initialize control handlers */ +static int LinuxInitControls(struct AdapterDrvData *drvData) +{ + s64 vblank_def; + s64 vblank_min; + s64 hblank; + u64 pixel_rate; + int ret; + + struct CameraDrvData *camera = drvData->camera; + struct v4l2_ctrl_handler *ctrl_hdlr = camera->ctrl_handler; + const struct CameraSensorMode *mode = camera->cur_mode; + ImgRect *rect = &(drvData->attr->imgRect); + + if (ctrl_hdlr == NULL) { + ret = v4l2_ctrl_handler_init(ctrl_hdlr, 10); + if (ret) { + HDF_LOGE("%s: [v4l2_ctrl_handler_init] failed.", __func__); + return ret; + } + } + ctrl_hdlr->lock = &drvData->mutex; + if (camera->link_freq == NULL) { + camera->link_freq = v4l2_ctrl_new_std(ctrl_hdlr, NULL, + V4L2_CID_LINK_FREQ, camera->link_freqs, camera->link_freqs, 1, camera->link_freqs); + if (camera->link_freq) { + camera->link_freq->flags |= V4L2_CTRL_FLAG_READ_ONLY; + } + } + + if (camera->pixel_rate == NULL) { + /* pixel_rate = link_freq * 2 * nr_of_lanes / bits_per_sample */ + pixel_rate = camera->link_freqs * 2 * 4; + do_div(pixel_rate, 10); + /* By default, PIXEL_RATE is read only */ + camera->pixel_rate = v4l2_ctrl_new_std(ctrl_hdlr, NULL, + V4L2_CID_PIXEL_RATE, pixel_rate, pixel_rate, 1, pixel_rate); + } + + /* Initialize vblank/hblank/exposure parameters based on current mode */ + if (camera->vblank == NULL) { + vblank_def = mode->fll_def - rect->height; + vblank_min = mode->fll_min - rect->height; + camera->vblank = v4l2_ctrl_new_std(ctrl_hdlr, NULL, + V4L2_CID_VBLANK, vblank_min, SENSOR_FLL_MAX - rect->height, 1, vblank_def); + } + + if (camera->hblank == NULL) { + hblank = mode->llp - rect->width; + camera->hblank = v4l2_ctrl_new_std(ctrl_hdlr, NULL, + V4L2_CID_HBLANK, hblank, hblank, 1, hblank); + if (camera->hblank) { + camera->hblank->flags |= V4L2_CTRL_FLAG_READ_ONLY; + } + } + if (ctrl_hdlr->error) { + ret = ctrl_hdlr->error; + HDF_LOGE("%s: control init failed: %d", __func__, ret); + v4l2_ctrl_handler_free(ctrl_hdlr); + return ret; + } + camera->sd->ctrl_handler = ctrl_hdlr; + + return 0; +} + +static int32_t MipiCsiAdapterTraceMipiCfg(ComboDevAttr *attr) +{ + unsigned int i; + MipiDevAttr *cfg = NULL; + + if (attr == NULL) { + HDF_LOGE("%s: attr is NULL!", __func__); + return HDF_ERR_INVALID_PARAM; + } + + cfg = &(attr->mipiAttr); + HDF_LOGD("%s: inputDataType = %d, wdrMode = %d", __func__, cfg->inputDataType, cfg->wdrMode); + for (i = 0; i < MIPI_LANE_NUM; i++) { + HDF_LOGD("laneId[%d] = %d", i, cfg->laneId[i]); + } + + HDF_LOGD("%s: inputMode = %d, dataRate = %d, imgRect(x = %d, y = %d, width = %d, height = %d).", + __func__, attr->inputMode, attr->dataRate, attr->imgRect.x, attr->imgRect.y, + attr->imgRect.width, attr->imgRect.height); + + return HDF_SUCCESS; +} + +static int32_t MipiCsiAdapterTraceCameraCfg(struct CameraDrvData *camera) +{ + const struct CameraSensorMode *mode = NULL; + if (camera == NULL) { + HDF_LOGE("%s: camera is NULL!", __func__); + return HDF_ERR_INVALID_PARAM; + } + + mode = camera->cur_mode; + HDF_LOGD("%s: link_freq = %lld", __func__, camera->link_freqs); + HDF_LOGD("%s: fll_def = %d, fll_min = %d, llp = %d.", __func__, mode->fll_def, mode->fll_min, mode->llp); + + return HDF_SUCCESS; +} + +static int32_t MipiCsiAdapterSetComboDevAttr(struct MipiCsiCntlr *cntlr, ComboDevAttr *pAttr) +{ + int32_t ret; + struct AdapterDrvData *drvData = (struct AdapterDrvData *)cntlr->priv; + struct v4l2_mbus_framefmt *fmt = NULL; + + if ((drvData == NULL) || (pAttr == NULL)) { + HDF_LOGE("%s: drvData or pAttr is NULL!", __func__); + return HDF_ERR_INVALID_PARAM; + } + + drvData->attr = pAttr; + fmt = &drvData->fmt.format; + fmt->width = pAttr->imgRect.width; + fmt->height = pAttr->imgRect.height; + fmt->code = LinuxGetFormatCode(pAttr->mipiAttr.inputDataType); + fmt->field = V4L2_FIELD_NONE; + + ret = MipiCsiAdapterTraceMipiCfg(pAttr); + + return ret; +} + +static int32_t MipiCsiAdapterResetRx(struct MipiCsiCntlr *cntlr, uint8_t comboDev) +{ + int32_t ret; + + (void)cntlr; + ret = SetStream(1); + return (ret == 0) ? HDF_SUCCESS : HDF_FAILURE; +} + +static int32_t MipiCsiAdapterUnresetRx(struct MipiCsiCntlr *cntlr, uint8_t comboDev) +{ + int32_t ret; + + (void)cntlr; + ret = SetStream(0); + return (ret == 0) ? HDF_SUCCESS : HDF_FAILURE; +} + +static int32_t MipiCsiAdapterProbeV4l2(struct MipiCsiCntlr *cntlr) +{ + int32_t ret; + struct AdapterDrvData *drvData = (struct AdapterDrvData *)cntlr->priv; + struct CameraDrvData *camera = NULL; + + if ((drvData == NULL) || (drvData->camera == NULL)) { + HDF_LOGE("%s: drvData or drvData->camera is NULL.", __func__); + return HDF_ERR_INVALID_PARAM; + } + + camera = drvData->camera; + /* Initialize subdev */ + v4l2_subdev_init(camera->sd, &g_cameraSubdevOps); + ret = LinuxInitControls(drvData); + if (ret) { + HDF_LOGE("%s: failed to init controls: %d", __func__, ret); + v4l2_ctrl_handler_free(camera->sd->ctrl_handler); + return HDF_FAILURE; + } + + mutex_init(&drvData->mutex); + return HDF_SUCCESS; +} + +static int32_t MipiCsiAdapterSetDrvData(struct MipiCsiCntlr *cntlr, void *cameraData) +{ + int32_t ret; + struct AdapterDrvData *drvData = (struct AdapterDrvData *)cntlr->priv;; + + if ((drvData == NULL) || (cameraData == NULL)) { + HDF_LOGE("%s: drvData or cameraData is NULL!", __func__); + return HDF_ERR_INVALID_PARAM; + } + drvData->camera = (struct CameraDrvData *)cameraData; + MipiCsiAdapterTraceCameraCfg(drvData->camera); + ret = MipiCsiAdapterProbeV4l2(cntlr); + + return ret; +} + +static struct MipiCsiCntlr g_mipiRx = { + .devNo = 0 +}; + +static struct MipiCsiCntlrMethod g_method = { + .setComboDevAttr = MipiCsiAdapterSetComboDevAttr, + .resetRx = MipiCsiAdapterResetRx, + .unresetRx = MipiCsiAdapterUnresetRx, + .setDrvData = MipiCsiAdapterSetDrvData, +}; + +static void MipiCsiAdapterRemoveV4l2(struct MipiCsiCntlr *cntlr) +{ + struct AdapterDrvData *drvData = (struct AdapterDrvData *)cntlr->priv; + struct CameraDrvData *camera = NULL; + + if ((drvData == NULL) || (drvData->camera == NULL)) { + HDF_LOGE("%s: drvData or drvData->camera is NULL!", __func__); + return; + } + + camera = drvData->camera; + if ((camera->sd != NULL) && (camera->sd->ctrl_handler != NULL)) { + v4l2_ctrl_handler_free(camera->sd->ctrl_handler); + camera->sd->ctrl_handler = NULL; + } + mutex_destroy(&drvData->mutex); + drvData->attr = NULL; + drvData->camera = NULL; +} + +static int32_t MipiCsiAdapterBind(struct HdfDeviceObject *device) +{ + int32_t ret; + + HDF_LOGI("%s: enter.", __func__); + g_mipiRx.priv = &g_adapterDrvData; + g_mipiRx.ops = &g_method; + ret = MipiCsiRegisterCntlr(&g_mipiRx, device); + if (ret != HDF_SUCCESS) { + return ret; + } + HDF_LOGI("%s: success.", __func__); + + return HDF_SUCCESS; +} + +static int32_t MipiCsiAdapterInit(struct HdfDeviceObject *device) +{ + (void)device; + + HDF_LOGI("%s: success.", __func__); + return HDF_SUCCESS; +} + +static void MipiCsiAdapterRelease(struct HdfDeviceObject *device) +{ + struct MipiCsiCntlr *cntlr = NULL; + + if (device == NULL) { + HDF_LOGE("%s: device is NULL.", __func__); + return; + } + cntlr = MipiCsiCntlrFromDevice(device); + if (cntlr == NULL) { + HDF_LOGE("%s: cntlr is NULL.", __func__); + return; + } + MipiCsiAdapterRemoveV4l2(cntlr); + MipiCsiUnregisterCntlr(cntlr); + cntlr->priv = NULL; + + HDF_LOGI("%s: success.", __func__); +} + +struct HdfDriverEntry g_mipiCsiLinuxDriverEntry = { + .moduleVersion = 1, + .Bind = MipiCsiAdapterBind, + .Init = MipiCsiAdapterInit, + .Release = MipiCsiAdapterRelease, + .moduleName = "linux_mipi_csi_adapter", +}; +HDF_INIT(g_mipiCsiLinuxDriverEntry); \ No newline at end of file diff --git a/platform/mipi_dsi/Makefile b/platform/mipi_dsi/Makefile index 337a1b32064efb061b6be71104209863fae5a85d..22d1105421629a510df342a4a1331add990b5f5c 100644 --- a/platform/mipi_dsi/Makefile +++ b/platform/mipi_dsi/Makefile @@ -18,7 +18,7 @@ obj-y += $(HDF_PLATFORM_FRAMEWORKS_ROOT)/src/mipi/mipi_dsi_core.o \ $(HDF_PLATFORM_FRAMEWORKS_ROOT)/src/mipi/mipi_dsi_if.o obj-$(CONFIG_DRM_MIPI_DSI) += mipi_drm_adapter.o -obj-y += mipi_tx_dev.o \ - mipi_tx_hi35xx.o +obj-y += mipi_tx_dev.o +# mipi_tx_hi35xx.o EXTRA_CFLAGS += -Wno-error=date-time diff --git a/platform/mipi_dsi/mipi_drm_adapter.c b/platform/mipi_dsi/mipi_drm_adapter.c index 72bdf30ed90e9ac8ab4b5e0b0a14c3ede1ffb8fd..58dd1fda70fa2fd1eb4601c3d3333bb2a03bfcfa 100644 --- a/platform/mipi_dsi/mipi_drm_adapter.c +++ b/platform/mipi_dsi/mipi_drm_adapter.c @@ -78,7 +78,7 @@ static int32_t MipiDsiAdapterAttach(struct MipiDsiCntlr *cntlr, uint8_t *name) return HDF_SUCCESS; } -static int32_t MipiDsiAdapterSetDrvData(struct MipiDsiCntlr *cntlr, DevHandle *panelData) +static int32_t MipiDsiAdapterSetDrvData(struct MipiDsiCntlr *cntlr, void *panelData) { struct mipi_dsi_device *linuxPanel; diff --git a/platform/mipi_dsi/mipi_tx_hi35xx.c b/platform/mipi_dsi/mipi_tx_hi35xx.c index b891a145acb2c0bd04d7ed7ae0970223880c7804..b72caf07a4a0982a9d900259f3f283f94532a40d 100644 --- a/platform/mipi_dsi/mipi_tx_hi35xx.c +++ b/platform/mipi_dsi/mipi_tx_hi35xx.c @@ -713,7 +713,6 @@ static int32_t LinuxCopyToKernel(void *dest, uint32_t max, const void *src, uint HDF_LOGE("%s: [memcpy_s] failed.", __func__); } } - HDF_LOGI("%s: success.", __func__); return ret; } @@ -765,7 +764,6 @@ static int MipiTxDrvSetCmdInfo(const CmdInfoTag *cmdInfo) HDF_LOGE("%s: [MipiTxWaitWriteFifoEmpty] failed.", __func__); return HDF_FAILURE; } - HDF_LOGD("%s: cmdSize = 0x%x, dataType = 0x%x", __func__, cmdInfo->cmdSize, cmdInfo->dataType); return HDF_SUCCESS; } @@ -887,7 +885,6 @@ static void MipiTxReset(void) static int MipiTxDrvGetCmdInfo(GetCmdInfoTag *getCmdInfo) { unsigned char *dataBuf = NULL; - HDF_LOGI("%s: enter!", __func__); dataBuf = (unsigned char*)OsalMemAlloc(getCmdInfo->getDataSize); if (dataBuf == NULL) { @@ -925,7 +922,6 @@ static int MipiTxDrvGetCmdInfo(GetCmdInfoTag *getCmdInfo) } OsalMemFree(dataBuf); dataBuf = NULL; - HDF_LOGI("%s: success!", __func__); return HDF_SUCCESS; fail0: @@ -1092,7 +1088,6 @@ static int MipiTxCheckCombDevCfg(const ComboDevCfgTag *devCfg) return HDF_ERR_INVALID_PARAM; } - HDF_LOGI("%s: success!", __func__); return HDF_SUCCESS; } @@ -1238,7 +1233,6 @@ static int MipiTxGetCmd(GetCmdInfoTag *getCmdInfo) static int32_t Hi35xxGetCmd(struct MipiDsiCntlr *cntlr, struct DsiCmdDesc *cmd, uint32_t readLen, uint8_t *out) { GetCmdInfoTag cmdInfo; - HDF_LOGI("%s: enter!", __func__); (void)cntlr; if (cmd == NULL || out == NULL) { @@ -1285,7 +1279,6 @@ static struct MipiDsiCntlrMethod g_method = { static int32_t Hi35xxMipiTxInit(struct HdfDeviceObject *device) { int32_t ret; - HDF_LOGI("%s: enter!", __func__); g_mipiTx.priv = NULL; g_mipiTx.ops = &g_method; diff --git a/platform/pwm/Makefile b/platform/pwm/Makefile index 534453f43bd837da82f030352bbc3db13d551827..0361c7475d834c1a9d5fb98f1ccbfc089b909f4b 100644 --- a/platform/pwm/Makefile +++ b/platform/pwm/Makefile @@ -14,5 +14,6 @@ include drivers/hdf/khdf/platform/platform.mk obj-$(CONFIG_DRIVERS_HDF_PLATFORM_PWM) += $(HDF_PLATFORM_FRAMEWORKS_ROOT)/src/pwm/pwm_core.o \ - pwm_adapter.o + $(HDF_PLATFORM_FRAMEWORKS_ROOT)/src/pwm/pwm_if.o \ + pwm_adapter.o obj-$(CONFIG_PWM_HI35XX) += pwm_hi35xx_linux.o diff --git a/test/Makefile b/test/Makefile index 59d56bb32a1d6326021db1b28e533b7d9baaba7e..0b87ba41904dcd050eb51ed1f4f19b717c9102d0 100644 --- a/test/Makefile +++ b/test/Makefile @@ -23,9 +23,10 @@ obj-y += $(HDF_FRAMWORK_TEST_ROOT)/common/hdf_main_test.o \ $(HDF_FRAMWORK_TEST_ROOT)/manager/sample_driver_test.o \ $(HDF_FRAMWORK_TEST_ROOT)/utils/hcs_parser/unittest/hcs_config_test.o \ $(HDF_FRAMWORK_TEST_ROOT)/utils/hcs_parser/unittest/hcs_parser_test.o \ - $(HDF_FRAMWORK_TEST_ROOT)/pm/pm_driver_test.o + $(HDF_FRAMWORK_TEST_ROOT)/pm/hdf_pm_driver_test.o obj-$(CONFIG_DRIVERS_HDF_PLATFORM_GPIO) += $(HDF_FRAMWORK_TEST_ROOT)/platform/common/gpio_test.o \ + $(HDF_FRAMWORK_TEST_ROOT)/platform/common/gpio_driver_test.o \ $(HDF_FRAMWORK_TEST_ROOT)/platform/entry/hdf_gpio_entry_test.o obj-$(CONFIG_DRIVERS_HDF_PLATFORM_I2C) += $(HDF_FRAMWORK_TEST_ROOT)/platform/common/i2c_test.o \ $(HDF_FRAMWORK_TEST_ROOT)/platform/common/i2c_driver_test.o \