; BayHubTech Integrated MMC/SD Controller INF file
; Copyright (c) 1997-2015 BayHubTech Corp.

[Version]
Signature   = "$Windows NT$"
Class       = SCSIAdapter
ClassGuid   = {4D36E97B-E325-11CE-BFC1-08002BE10318}
Provider    = %O2Micro%
DriverVer   = 05/04/2015,1.2.2.1076
Catalogfile = O2FJ2.cat

[SourceDisksNames]
1 = %O2SDR.DriverDisk%

[SourceDisksFiles]
O2FJ2.sys = 1
o2flash.exe = 1
bhtv5Icon.dll = 1
SDPA8220.dll = 1

[DestinationDirs]
DefaultDestDir = 12
CopyO2Flash = 12
Copybhtv5Icon = 11
CopySDPA8220 = 11, SDA

[ControlFlags]
ExcludeFromSelect = *

[Manufacturer]
%O2Micro% = O2FJ2RDR

[O2FJ2RDR]
%O2SDR.DeviceDesc% = DriverInstall, PCI\VEN_1217&DEV_8420		;Default for SDS1

%O2SDR.DeviceDesc% = DriverInstall, PCI\VEN_1217&DEV_8520		;Default for Fujin2
%O2SDR.DeviceDesc% = DriverInstall, PCI\VEN_1217&DEV_8620		;Default for SeaBird
%O2SDR.DeviceDesc% = DriverInstall, PCI\VEN_1217&DEV_8621		;Default for SeaBird


%O2SDR.DeviceDesc% = DriverInstall_DELL, PCI\VEN_1217&DEV_8520&SUBSYS_06251028;For Dell
%O2SDR.DeviceDesc% = DriverInstall_DELL, PCI\VEN_1217&DEV_8520&SUBSYS_06261028;For Dell

;Add output tuning for lenovo
%O2SDR.DeviceDesc% = DriverInstall_222c17aa, PCI\VEN_1217&DEV_8621&SUBSYS_222c17aa ;For lenovo
%O2SDR.DeviceDesc% = DriverInstall_222c17aa, PCI\VEN_1217&DEV_8520&SUBSYS_221117aa ;For lenovo
%O2SDR.DeviceDesc% = DriverInstall_222c17aa, PCI\VEN_1217&DEV_8621&SUBSYS_380017aa ;For lenovo

;Add MMC disable and output tuning for NEC
%O2SDR.DeviceDesc% = DriverInstall_607e17aa, PCI\VEN_1217&DEV_8520&SUBSYS_607e17aa ;For NEC

%O2SDR.DeviceDesc% = DriverInstall_06EF1028, PCI\VEN_1217&DEV_8520&SUBSYS_06EF1028 ;For Dell

[DriverInstall.NT]
CopyFiles = @O2FJ2.sys
CopyFiles = CopyO2Flash,Copybhtv5Icon,CopySDPA8220


;Support Runtime D3 in Win8
[DriverInstall.NT.HW]
Include = machine.inf
Needs = PciD3ColdSupported

[DriverInstall.NT.Services]
AddService = O2FJ2RDR, 0x00000002 , DriverService;, EventLogService
AddService = O2FLASH, 0x00000800 , Flash_Service_Inst

[DriverInstall_LNV.NT]
CopyFiles = @O2FJ2.sys
CopyFiles = CopyO2Flash,Copybhtv5Icon,CopySDPA8220


;Support Runtime D3 in Win8
[DriverInstall_LNV.NT.HW]
Include = machine.inf
Needs = PciD3ColdSupported

[DriverInstall_LNV.NT.Services]
AddService = O2FJ2RDR, 0x00000002 , DriverService_LNV;, EventLogService
AddService = O2FLASH, 0x00000800 , Flash_Service_Inst

[DriverService_LNV]
ServiceType    = 1                  ; SERVICE_KERNEL_DRIVER
StartType      = 3                  ; SERVICE_DEMAND_START
ErrorControl   = 1                  
LoadOrderGroup = SCSI Miniport
ServiceBinary  = %12%\O2FJ2.sys
AddReg         = pnpsafe_pci_addreg
AddReg         = bus_type_o2
AddReg         = output_tuning
;AddReg         = icon_label


[DriverInstall_DELL.NT]
CopyFiles = @O2FJ2.sys
CopyFiles = CopyO2Flash,Copybhtv5Icon,CopySDPA8220


;Support Runtime D3 in Win8
[DriverInstall_DELL.NT.HW]
Include = machine.inf
Needs = PciD3ColdSupported

[DriverInstall_DELL.NT.Services]
AddService = O2FJ2RDR, 0x00000002 , DriverService_DELL;, EventLogService
AddService = O2FLASH, 0x00000800 , Flash_Service_Inst

[DriverService_DELL]
ServiceType    = 1                  ; SERVICE_KERNEL_DRIVER
StartType      = 3                  ; SERVICE_DEMAND_START
ErrorControl   = 1                  
LoadOrderGroup = SCSI Miniport
ServiceBinary  = %12%\O2FJ2.sys
AddReg         = pnpsafe_pci_addreg
AddReg         = bus_type_o2
AddReg         = CLK_Setting
;AddReg         = icon_label

[DriverInstall_222c17aa.NT]
CopyFiles = @O2FJ2.sys
CopyFiles = CopyO2Flash,Copybhtv5Icon,CopySDPA8220
;Support Runtime D3 in Win8
[DriverInstall_222c17aa.NT.HW]
Include = machine.inf
Needs = PciD3ColdSupported
[DriverInstall_222c17aa.NT.Services]
AddService = O2FJ2RDR, 0x00000002 , DriverService_222c17aa;, EventLogService
AddService = O2FLASH, 0x00000800 , Flash_Service_Inst
[DriverService_222c17aa]
ServiceType    = 1                  ; SERVICE_KERNEL_DRIVER
StartType      = 3                  ; SERVICE_DEMAND_START
ErrorControl   = 1                  
LoadOrderGroup = SCSI Miniport
ServiceBinary  = %12%\O2FJ2.sys
AddReg         = pnpsafe_pci_addreg
AddReg         = bus_type_o2
AddReg         = 222c17aa
;AddReg         = icon_label

[DriverInstall_607e17aa.NT]
CopyFiles = @O2FJ2.sys
CopyFiles = CopyO2Flash,Copybhtv5Icon,Copybhtv5Icon_2,CopySDPA8220
;Support Runtime D3 in Win8
[DriverInstall_607e17aa.NT.HW]
Include = machine.inf
Needs = PciD3ColdSupported
[DriverInstall_607e17aa.NT.Services]
AddService = O2FJ2RDR, 0x00000002 , DriverService_607e17aa;, EventLogService
AddService = O2FLASH, 0x00000800 , Flash_Service_Inst
[DriverService_607e17aa]
ServiceType    = 1                  ; SERVICE_KERNEL_DRIVER
StartType      = 3                  ; SERVICE_DEMAND_START
ErrorControl   = 1                  
LoadOrderGroup = SCSI Miniport
ServiceBinary  = %12%\O2FJ2.sys
AddReg         = pnpsafe_pci_addreg
AddReg         = bus_type_o2
AddReg         = 607e17aa
;AddReg         = icon_label


[DriverInstall_06EF1028.NT]
CopyFiles = @O2FJ2.sys
CopyFiles = CopyO2Flash,Copybhtv5Icon,CopySDPA8220
;Support Runtime D3 in Win8
[DriverInstall_06EF1028.NT.HW]
Include = machine.inf
Needs = PciD3ColdSupported
[DriverInstall_06EF1028.NT.Services]
AddService = O2FJ2RDR, 0x00000002 , DriverService_06EF1028;, EventLogService
AddService = O2FLASH, 0x00000800 , Flash_Service_Inst
[DriverService_06EF1028]
ServiceType    = 1                  ; SERVICE_KERNEL_DRIVER
StartType      = 3                  ; SERVICE_DEMAND_START
ErrorControl   = 1                  
LoadOrderGroup = SCSI Miniport
ServiceBinary  = %12%\O2FJ2.sys
AddReg         = pnpsafe_pci_addreg
AddReg         = bus_type_o2
AddReg         = 06EF1028
;AddReg         = icon_label

[DriverService]
ServiceType    = 1                  ; SERVICE_KERNEL_DRIVER
StartType      = 3                  ; SERVICE_DEMAND_START
ErrorControl   = 1                  
LoadOrderGroup = SCSI Miniport
ServiceBinary  = %12%\O2FJ2.sys
AddReg         = pnpsafe_pci_addreg
AddReg         = bus_type_o2
;AddReg         = icon_label

[output_tuning]
HKR,"Parameters", "OUTPUT_TUNING", 0x00010001, 0xF4000000

[222c17aa]
HKR,"Parameters", "OUTPUT_TUNING", 0x00010001, 0xF4000000
HKR,"Parameters", "MISC_MODE", 0x00010001, 0x108a
[607e17aa]
HKR,"Parameters", "OUTPUT_TUNING", 0x00010001, 0xa0000000
HKR,"Parameters", "MISC_MODE", 0x00010001, 0x108a
HKR,"Parameters", "MMC_MODE", 0x00010001, 0x80000000

[06EF1028]
HKR,"Parameters", "OUTPUT_TUNING", 0x00010001, 0xe0000000
HKR,"Parameters", "MISC_MODE", 0x00010001, 0x108e

[CLK_Setting]
HKR,"Parameters", "OUTPUT_TUNING", 0x00010001, 0xF6000000     ;DLL setting phase
HKR,"Parameters", "SD_CLK_Driver_strength_33V", 0x00010001, 0x80000002     ;SD2.0/3.0 CLK driving = "010"b
HKR,"Parameters", "SD_CLK_Driver_strength_18V", 0x00010001, 0x80000002     ;SD2.0/3.0 CLK driving = "010"b
HKR,"Parameters", "POWER_WAIT_TIME", 0x00010001, 0x015e000a                ;power on delay

[CopyO2Flash]
o2flash.exe

[Copybhtv5Icon]
bhtv5Icon.dll

[CopySDPA8220]
SDPA8220.dll

[EventLogService]
AddReg = EventLogService_AddReg

[EventLogService_AddReg]
;HKR,,EventMessageFile, 0x00020000, "%%SystemRoot%%\System32\drivers\O2FJ2.sys"
HKR,,EventMessageFile, 0x00020000, "%%SystemRoot%%\System32\IoLogMsg.dll"
HKR,,TypesSupported,   0x00010001, 7

[pnpsafe_pci_addreg]
HKR, "Parameters\PnpInterface", "5", 0x00010001, 0x00000001

[bus_type_o2]
HKR,"Parameters", "BusType", 0x00010001, 0x0000000c

;[icon_label]
;HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\PerHwIdStorage\SCSI#DiskO2Micro_SD______________0001","Icons",0x00010000,"%SystemRoot%\system32\bhtv5Icon.dll,-299"
;HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\PerHwIdStorage\SCSI#DiskO2Micro_SD______________0001","Label",,"SD Disk"
;HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\PerHwIdStorage\SCSI#DiskO2Micro_SD______________0001","NoSoftEject",0x00010001,0x00000001
;HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\PerHwIdStorage\SCSI#DiskO2Micro_SD______________0001","DeviceGroup",,"SDStorage"

;HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\PerHwIdStorage\SCSI#DiskO2Micro_MMC_____________0001","Icons",0x00010000,"%SystemRoot%\system32\bhtv5Icon.dll,-297"
;HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\PerHwIdStorage\SCSI#DiskO2Micro_MMC_____________0001","Label",,"MMC Disk"
;HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\PerHwIdStorage\SCSI#DiskO2Micro_MMC_____________0001","NoSoftEject",0x00010001,0x00000001
;HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\PerHwIdStorage\SCSI#DiskO2Micro_MMC_____________0001","DeviceGroup",,"MMCStorage"

[Flash_Service_Inst]
DisplayName  = O2FLASH
ServiceType   = 0x0010                  ; SERVICE_KERNEL_DRIVER
StartType       = 2                           ; SERVICE_DEMAND_START
ErrorControl    = 1                  
ServiceBinary = %12%\o2flash.exe
AddReg             = Delay_Start

[Delay_Start]
HKLM,"SYSTEM\CurrentControlSet\Services\O2Flash","DelayedAutoStart",0x00010001,0x00000000

[Strings]
REG_SZ        = 0x00000000
REG_MULTI_SZ  = 0x00010000
REG_EXPAND_SZ = 0x00020000
REG_BINARY    = 0x00000001
REG_DWORD     = 0x00010001
SERVICEROOT   = "System\CurrentControlSet\Services"

O2Micro          = "BayHubTech/O2Micro"
O2SDR.DeviceDesc = "BayHubTech/O2Micro Integrated MMC/SD controller"
O2SDR.DriverDisk = "BayHubTech/O2Micro Integrated MMC/SD controller Driver Disk"
;O2SDR.DeviceDesc_LNV = "O2Micro Integrated MMC/SD controller LNV"
