This file implements I2C IO Protocol which enables the user to manipulate a single \r
I2C device independent of the host controller and I2C design.\r
\r
- Copyright (c) 2013, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2013 - 2014, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
EFI_HANDLE *DeviceHandleBuffer;\r
UINTN DeviceHandleCount;\r
UINTN Index;\r
+ EFI_COMPONENT_NAME_PROTOCOL *ComponentName;\r
+ EFI_COMPONENT_NAME2_PROTOCOL *ComponentName2;\r
\r
//\r
// Get the list of all I2C Controller handles in the handle database.\r
gI2cBusDriverBinding.DriverBindingHandle,\r
&gEfiDriverBindingProtocolGuid,\r
&gI2cBusDriverBinding,\r
- &gEfiComponentNameProtocolGuid,\r
- &gI2cBusComponentName,\r
- &gEfiComponentName2ProtocolGuid,\r
- &gI2cBusComponentName2,\r
NULL\r
);\r
ASSERT_EFI_ERROR (Status);\r
\r
+ //\r
+ // Note we have to one by one uninstall the following protocols.\r
+ // It's because some of them are optionally installed based on\r
+ // the following PCD settings.\r
+ // gEfiMdePkgTokenSpaceGuid.PcdDriverDiagnosticsDisable\r
+ // gEfiMdePkgTokenSpaceGuid.PcdComponentNameDisable\r
+ // gEfiMdePkgTokenSpaceGuid.PcdDriverDiagnostics2Disable\r
+ // gEfiMdePkgTokenSpaceGuid.PcdComponentName2Disable\r
+ //\r
+ Status = gBS->HandleProtocol (\r
+ gI2cBusDriverBinding.DriverBindingHandle,\r
+ &gEfiComponentNameProtocolGuid,\r
+ (VOID **) &ComponentName\r
+ );\r
+ if (!EFI_ERROR (Status)) {\r
+ gBS->UninstallProtocolInterface (\r
+ gI2cBusDriverBinding.DriverBindingHandle,\r
+ &gEfiComponentNameProtocolGuid,\r
+ ComponentName\r
+ );\r
+ }\r
+\r
+ Status = gBS->HandleProtocol (\r
+ gI2cBusDriverBinding.DriverBindingHandle,\r
+ &gEfiComponentName2ProtocolGuid,\r
+ (VOID **) &ComponentName2\r
+ );\r
+ if (!EFI_ERROR (Status)) {\r
+ gBS->UninstallProtocolInterface (\r
+ gI2cBusDriverBinding.DriverBindingHandle,\r
+ &gEfiComponentName2ProtocolGuid,\r
+ ComponentName2\r
+ );\r
+ }\r
+\r
+ Status = EFI_SUCCESS;\r
+\r
Done:\r
//\r
// Free the buffer containing the list of handles from the handle database\r
This file implements I2C Host Protocol which provides callers with the ability to \r
do I/O transactions to all of the devices on the I2C bus.\r
\r
- Copyright (c) 2013, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2013 - 2014, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
EFI_HANDLE *DeviceHandleBuffer;\r
UINTN DeviceHandleCount;\r
UINTN Index;\r
+ EFI_COMPONENT_NAME_PROTOCOL *ComponentName;\r
+ EFI_COMPONENT_NAME2_PROTOCOL *ComponentName2;\r
\r
//\r
// Get the list of all I2C Controller handles in the handle database.\r
gI2cHostDriverBinding.DriverBindingHandle,\r
&gEfiDriverBindingProtocolGuid,\r
&gI2cHostDriverBinding,\r
- &gEfiComponentNameProtocolGuid,\r
- &gI2cHostComponentName,\r
- &gEfiComponentName2ProtocolGuid,\r
- &gI2cHostComponentName2,\r
NULL\r
);\r
ASSERT_EFI_ERROR (Status);\r
\r
+ //\r
+ // Note we have to one by one uninstall the following protocols.\r
+ // It's because some of them are optionally installed based on\r
+ // the following PCD settings.\r
+ // gEfiMdePkgTokenSpaceGuid.PcdDriverDiagnosticsDisable\r
+ // gEfiMdePkgTokenSpaceGuid.PcdComponentNameDisable\r
+ // gEfiMdePkgTokenSpaceGuid.PcdDriverDiagnostics2Disable\r
+ // gEfiMdePkgTokenSpaceGuid.PcdComponentName2Disable\r
+ //\r
+ Status = gBS->HandleProtocol (\r
+ gI2cHostDriverBinding.DriverBindingHandle,\r
+ &gEfiComponentNameProtocolGuid,\r
+ (VOID **) &ComponentName\r
+ );\r
+ if (!EFI_ERROR (Status)) {\r
+ gBS->UninstallProtocolInterface (\r
+ gI2cHostDriverBinding.DriverBindingHandle,\r
+ &gEfiComponentNameProtocolGuid,\r
+ ComponentName\r
+ );\r
+ }\r
+\r
+ Status = gBS->HandleProtocol (\r
+ gI2cHostDriverBinding.DriverBindingHandle,\r
+ &gEfiComponentName2ProtocolGuid,\r
+ (VOID **) &ComponentName2\r
+ );\r
+ if (!EFI_ERROR (Status)) {\r
+ gBS->UninstallProtocolInterface (\r
+ gI2cHostDriverBinding.DriverBindingHandle,\r
+ &gEfiComponentName2ProtocolGuid,\r
+ ComponentName2\r
+ );\r
+ }\r
+\r
+ Status = EFI_SUCCESS;\r
+\r
Done:\r
//\r
// Free the buffer containing the list of handles from the handle database\r