11bd4fe43Sopenharmony_ci/* 21bd4fe43Sopenharmony_ci * Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED. 31bd4fe43Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 41bd4fe43Sopenharmony_ci * you may not use this file except in compliance with the License. 51bd4fe43Sopenharmony_ci * You may obtain a copy of the License at 61bd4fe43Sopenharmony_ci * 71bd4fe43Sopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 81bd4fe43Sopenharmony_ci * 91bd4fe43Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software 101bd4fe43Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 111bd4fe43Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 121bd4fe43Sopenharmony_ci * See the License for the specific language governing permissions and 131bd4fe43Sopenharmony_ci * limitations under the License. 141bd4fe43Sopenharmony_ci */ 151bd4fe43Sopenharmony_ci 161bd4fe43Sopenharmony_ci#include "hdf_base.h" 171bd4fe43Sopenharmony_ci#include "hdf_device_desc.h" 181bd4fe43Sopenharmony_ci#include "hdf_log.h" 191bd4fe43Sopenharmony_ci 201bd4fe43Sopenharmony_ciextern void SDK_init(void); 211bd4fe43Sopenharmony_ciextern void SDK_init2(void); 221bd4fe43Sopenharmony_ci 231bd4fe43Sopenharmony_cistatic int32_t HisiSdkBind(struct HdfDeviceObject *device) 241bd4fe43Sopenharmony_ci{ 251bd4fe43Sopenharmony_ci static struct IDeviceIoService service; 261bd4fe43Sopenharmony_ci if (device == NULL) { 271bd4fe43Sopenharmony_ci HDF_LOGE("%s: device is null!", __func__); 281bd4fe43Sopenharmony_ci return HDF_ERR_INVALID_OBJECT; 291bd4fe43Sopenharmony_ci } 301bd4fe43Sopenharmony_ci device->service = &service; 311bd4fe43Sopenharmony_ci HDF_LOGI("%s: calling SDK_init form HDF", __func__); 321bd4fe43Sopenharmony_ci SDK_init(); 331bd4fe43Sopenharmony_ci HDF_LOGI("%s: SDK service init done!", __func__); 341bd4fe43Sopenharmony_ci return HDF_SUCCESS; 351bd4fe43Sopenharmony_ci} 361bd4fe43Sopenharmony_ci 371bd4fe43Sopenharmony_cistatic int32_t HisiSdkInit(struct HdfDeviceObject *device) 381bd4fe43Sopenharmony_ci{ 391bd4fe43Sopenharmony_ci (void)device; 401bd4fe43Sopenharmony_ci return HDF_SUCCESS; 411bd4fe43Sopenharmony_ci} 421bd4fe43Sopenharmony_ci 431bd4fe43Sopenharmony_cistatic void HisiSdkRelease(struct HdfDeviceObject *device) 441bd4fe43Sopenharmony_ci{ 451bd4fe43Sopenharmony_ci (void)device; 461bd4fe43Sopenharmony_ci} 471bd4fe43Sopenharmony_ci 481bd4fe43Sopenharmony_cistruct HdfDriverEntry g_hisiSdkEntry = { 491bd4fe43Sopenharmony_ci .moduleVersion = 1, 501bd4fe43Sopenharmony_ci .Bind = HisiSdkBind, 511bd4fe43Sopenharmony_ci .Init = HisiSdkInit, 521bd4fe43Sopenharmony_ci .Release = HisiSdkRelease, 531bd4fe43Sopenharmony_ci .moduleName = "HDF_PLATFORM_HISI_SDK", 541bd4fe43Sopenharmony_ci}; 551bd4fe43Sopenharmony_ciHDF_INIT(g_hisiSdkEntry); 561bd4fe43Sopenharmony_ci 571bd4fe43Sopenharmony_cistatic int32_t HisiSdkBind2(struct HdfDeviceObject *device) 581bd4fe43Sopenharmony_ci{ 591bd4fe43Sopenharmony_ci static struct IDeviceIoService service; 601bd4fe43Sopenharmony_ci if (device == NULL) { 611bd4fe43Sopenharmony_ci HDF_LOGE("%s: device is null!", __func__); 621bd4fe43Sopenharmony_ci return HDF_ERR_INVALID_OBJECT; 631bd4fe43Sopenharmony_ci } 641bd4fe43Sopenharmony_ci device->service = &service; 651bd4fe43Sopenharmony_ci HDF_LOGI("%s: calling SDK_init2 form HDF", __func__); 661bd4fe43Sopenharmony_ci SDK_init2(); 671bd4fe43Sopenharmony_ci HDF_LOGI("%s: SDK service init done!", __func__); 681bd4fe43Sopenharmony_ci return HDF_SUCCESS; 691bd4fe43Sopenharmony_ci} 701bd4fe43Sopenharmony_ci 711bd4fe43Sopenharmony_cistatic int32_t HisiSdkInit2(struct HdfDeviceObject *device) 721bd4fe43Sopenharmony_ci{ 731bd4fe43Sopenharmony_ci (void)device; 741bd4fe43Sopenharmony_ci return HDF_SUCCESS; 751bd4fe43Sopenharmony_ci} 761bd4fe43Sopenharmony_ci 771bd4fe43Sopenharmony_cistatic void HisiSdkRelease2(struct HdfDeviceObject *device) 781bd4fe43Sopenharmony_ci{ 791bd4fe43Sopenharmony_ci (void)device; 801bd4fe43Sopenharmony_ci} 811bd4fe43Sopenharmony_ci 821bd4fe43Sopenharmony_cistruct HdfDriverEntry g_hisiSdkEntry2 = { 831bd4fe43Sopenharmony_ci .moduleVersion = 1, 841bd4fe43Sopenharmony_ci .Bind = HisiSdkBind2, 851bd4fe43Sopenharmony_ci .Init = HisiSdkInit2, 861bd4fe43Sopenharmony_ci .Release = HisiSdkRelease2, 871bd4fe43Sopenharmony_ci .moduleName = "HDF_PLATFORM_HISI_SDK2", 881bd4fe43Sopenharmony_ci}; 891bd4fe43Sopenharmony_ciHDF_INIT(g_hisiSdkEntry2); 90