Summary of the invention
In order to solve above-mentioned technical problem, this application discloses a kind of tuner and drive control method and relevant apparatus.
First aspect, this application provides a kind of tuner and drives control method, and described method includes:
Judge whether the tuner driver that in described TV motherboard, tuner interface currently runs connects with described tuner
The current target tuner connected of mouth is compatible;
When the tuner driver of described current operation is incompatible with described target tuner, connect from TV motherboard
Preset the Identity Code ID obtaining described target tuner in bus;
The target drives program corresponding with described ID is searched from preset memory locations;
Described target tuner is initialized by the described target drives program according to finding.
In conjunction with first aspect, in the first feasible embodiment of first aspect, described method also includes:
Whether the tuner of the tuner interface connection detecting described TV motherboard is changed;
When the tuner detecting that the tuner interface of described TV motherboard connects is changed, obtain the tuner pair after changing
The driver source code answered;
It is compiled as performing driver by described driver source code;
Performed driver after described compiling is stored in described preset memory locations.
In conjunction with the first feasible embodiment of first aspect, in the embodiment that first aspect the second is feasible, by institute
State the performed driver after compiling and be stored in described preset memory locations, including:
Determine that described current driver is corresponding in described preset memory locations and take memory area;
The reserved isolated area after memory area will have been taken as target storage described in described preset memory locations
Territory;
Performed driver after writing described compiling in territory, described target storage.
In conjunction with the first feasible embodiment of first aspect, in the third feasible embodiment of first aspect, by institute
State the performed driver after compiling and be stored in described preset memory locations, including:
Determine described current driver storage position, last position in described preset memory locations;
With the next storage position of storage position, position, described end as start bit, write the performed driving journey after described compiling successively
The data that ordered pair is answered.
In conjunction with the first feasible embodiment of first aspect, in the 4th kind of feasible embodiment of first aspect, detection
Whether the tuner that the tuner interface of described TV motherboard connects is changed, including:
The chip type that the tuner of the tuner interface connection obtaining described TV motherboard is corresponding identifies;
Described chip type mark and preset kind mark are compared;
If described chip type mark is inconsistent with preset kind mark, it is determined that TV motherboard is configured with new model and adjusts
Humorous device.
Second aspect, this application provides a kind of tuner and drives dynamic control device, and described device includes:
Compliance detection unit, for judging the tuner driver that in described TV motherboard, tuner interface currently runs
The target tuner whether being currently connected with described tuner interface is compatible;
ID acquiring unit, is used for when the tuner driver of described current operation is incompatible with described target tuner,
The Identity Code ID of described target tuner is obtained from the default bus that TV motherboard connects;
Target program searches unit, for searching the target drives program corresponding with described ID from preset memory locations;
Drive performance element, for described target tuner being carried out initially according to the described target drives program found
Change.
In conjunction with second aspect, in the first feasible embodiment of second aspect, described device also includes:
Interface detector unit, whether the tuner connected for detecting the tuner interface of described TV motherboard is changed;
Source code acquiring unit, during for changing at the tuner detecting that the tuner interface of described TV motherboard connects, obtains
Take the driver source code that the tuner after replacing is corresponding;
Source code compilation unit, for being compiled as performing driver by described driver source code;
Program writing unit, for being stored in described preset memory locations by the performed driver after described compiling.
In conjunction with the first feasible embodiment of second aspect, in the embodiment that second aspect the second is feasible, for reality
Now the performed driver after described compiling is stored in described preset memory locations, described program writing unit specifically quilt
It is configured that
Determine that described current driver is corresponding in described preset memory locations and take memory area;
The reserved isolated area after memory area will have been taken as target storage described in described preset memory locations
Territory, and the performed driver after writing described compiling in territory, described target storage.
In conjunction with the first feasible embodiment of second aspect, in the third feasible embodiment of second aspect, for reality
Now the performed driver after described compiling is stored in described preset memory locations, described program writing unit specifically quilt
It is configured that
Determine described current driver storage position, last position in described preset memory locations, and with storage position, position, described end
Next storage position be start bit, write the data that the performed driver after described compiling is corresponding successively.
In conjunction with the first feasible embodiment of second aspect, in the 4th kind of feasible embodiment of second aspect, for reality
Whether the tuner of the tuner interface connection now detecting described TV motherboard is changed, and described interface detector unit is specifically joined
It is set to:
The chip type that the tuner of the tuner interface connection obtaining described TV motherboard is corresponding identifies, and by described chip
Type identification and preset kind mark are compared, if described chip type mark is inconsistent, then with preset kind mark
Determine and TV motherboard is configured with new model tuner.
From above technical scheme, the embodiment of the present application tuning that tuner interface currently runs in described TV motherboard
When target tuner that device driver is currently connected with described tuner interface is incompatible, first pass through from TV motherboard even
The default bus connect obtains the ID value that target tuner is corresponding, then collects lookup and this ID value at preset memory locations
Corresponding target drives program, this target drives program namely the driver matched with target tuner, thus call
This target drives program, can complete the driving to target tuner.Relative to prior art, the embodiment of the present application is permissible
Realize the same edition system driver compatibility Multiple Type tuner of TV motherboard, it is not necessary to for every kind of model tuning
Device is developed respectively and safeguards a kind of system driver version, such that it is able to be substantially reduced Driver Development and maintenance work
Amount.
Detailed description of the invention
Here will illustrate exemplary embodiment in detail, its example represents in the accompanying drawings.Explained below relates to attached
During figure, unless otherwise indicated, the same numbers in different accompanying drawings represents same or analogous key element.Following exemplary is implemented
Embodiment described in example does not represent all embodiments consistent with the present invention.On the contrary, they be only with such as
The example of the apparatus and method that some aspects that described in detail in appended claims, the present invention are consistent.
First the tuner provided the application drives the embodiment of control method to illustrate.Fig. 1 is one reality of the application
The tuner that executing example provides drives control method flow chart, and the method is applied to TV motherboard;With reference to Fig. 1, the method bag
Include following steps.
S11, judge tuner driver that in described TV motherboard, tuner interface currently runs whether with described tuning
The target tuner that device interface currently connects is compatible.
S12, when tuner driver and the described target tuner of described current operation are incompatible, from TV motherboard
The default bus connected obtains the Identity Code ID of described target tuner.
S13, the target drives program that lookup is corresponding with described ID from preset memory locations.
Described target tuner is initialized by the described target drives program that S14, basis find.
Default bus described in above-mentioned steps S12 is specifically as follows I2C (Inter-Integrated Circuit, also
I2C can be designated as) bus is the two two-way continuous buses of line, it is provided that the communication line between integrated circuit, specific to this
TV motherboard described in application, system driver can realize the driving to hardware chips such as tuner by I2C bus
Control, I can also be passed through simultaneously2C bus obtains the relevant information (such as chip status etc.) of each chip.With reference to Fig. 2 institute
For receiving the chip structure figure of TV signal in the TV motherboard shown, after TV motherboard accesses bus, tuner (tuner)
It is connected with bus respectively with demodulator (demod), by this I when system driver performs2C bus is conciliate to tuner
Adjust device to send driving instruction, high-frequency TV signal be converted to intermediate-freuqncy signal controlling tuner, and control demodulator will
This intermediate-freuqncy signal is converted to transmission stream (Transport Stream, TS), and then can pass through decoder (decoder)
TS stream is decoded, obtains video decoding signal and the audio decoder signal that can play.
The tuner of every kind of model all has unique Identity Code, i.e. ID.According to above-mentioned based on I2The driving of C bus
Control logic, during system driver performs, when needing to drive tuner, when detecting in system driver
The tuner that original tuner driver is current connected with the tuner interface of TV motherboard, i.e. target tuner,
Time incompatible, can be first from I2C bus reads the ID value of the current tuner connected, then looks in preset memory locations
Look for the target drives program corresponding with this ID value;Due to the corresponding unique ID of the tuner of every kind of model, therefore find
The inevitable target tuner current connected with tuner interface of target drives program matches, and then according to this target drives
Program, can realize the initialization to target tuner.
From above technical scheme, the embodiment of the present application tuning that tuner interface currently runs in described TV motherboard
When target tuner that device driver is currently connected with described tuner interface is incompatible, first pass through from TV motherboard even
The default bus connect obtains the ID value that target tuner is corresponding, then collects lookup and this ID value at preset memory locations
Corresponding target drives program, this target drives program namely the driver matched with target tuner, thus call
This target drives program, can complete the driving to target tuner.Based on the embodiment of the present application, developing whole TV
During the system driver of mainboard, can add in same system driver and compile driving of polytype tuner
Dynamic program, and in practical implementation, the tuner driver of current operation and the target being currently connected detected
When tuner is incompatible, obtains the ID value of target tuner, and find according to this ID value and match with target tuner
Target drives program.Relative to prior art, the embodiment of the present application can realize the same edition system of TV motherboard and drive
Dynamic program compatibility Multiple Type tuner, it is not necessary to develop respectively for every kind of model tuner and safeguard a kind of system drive
Program version, such that it is able to be substantially reduced Driver Development and maintenance workload.
With reference to Fig. 3, in one feasible embodiment of the application, in above-mentioned TV motherboard, tuner driving method, also may be used
To comprise the following steps:
Whether S15, the tuner of the tuner interface connection detecting described TV motherboard are changed;
S16, when detect described TV motherboard tuner interface connect tuner change time, obtain change after tune
The driver source code that humorous device is corresponding;
S17, it is compiled as performing driver by described driver source code;
S18, the performed driver after described compiling is stored in described preset memory locations.
Due to the application can the driver of compatible multiple tuners, therefore connect at the tuner interface of described TV motherboard
Tuner change and (connect a kind of new model tuner in TV motherboard, in the existing system driver of TV motherboard not
There is its driver) time, the driver source code that the tuner after replacing is corresponding can be obtained in real time, to this driving journey
Sequence source code is compiled, and the performed driver that described compiling obtains is stored in described preset memory locations, thus
The driver that newly-increased tuner is corresponding can be got at any time from preset memory locations.
It addition, the driver corresponding for ease of searching each ID in preset memory locations, existing tuner is driven
Dynamic program, can arrange the corresponding relation between itself and ID value, as shown in table 1 below:
Table 1 ID and the default mapping relations table of driver
Tuner ID |
Driver storage address |
001 |
address1 |
002 |
address2 |
… |
… |
Assume, when the ID of the target tuner got is 001, to may determine that target drives according to above-mentioned mapping relations
The storage address of program is address1, such that it is able to directly read target drives program from address1.Assume
When the tuner that newly-increased a kind of ID is 010, default corresponding relation adds a new mapping, as shown in table 2 below:
Table 2 ID and the default mapping relations table of driver
Tuner ID |
Driver storage address |
001 |
address1 |
002 |
address2 |
… |
… |
010 |
address10 |
In one feasible embodiment of the application, described in above-mentioned steps S18 by the performed driving journey after described compiling
Sequence is stored in described preset memory locations, specifically may comprise steps of:
S181, determine that described current driver is corresponding in described preset memory locations and take memory area;
S182, deposit having taken the reserved isolated area after memory area described in described preset memory locations as target
Storage area territory;
S183, in territory, described target storage, write described compiling after performed driver.
In hardware controls based on software program, for the hardware configuration determined, its software control system framework has also been
Whole and determine, determine during software control module corresponding to the most each hardware element position in the system architecture is described.Specifically
Driving to TV motherboard and control, tuner is as one of them hardware chip, and its driver is in system driver
There is also relatively fixed position, due to the present embodiment can the driver of compatible different model tuner, therefore for newly
Increase the driver of tuner, the parallel position of original tuner driver can be stored in, it is simple to centralized maintenance.
Specific to the storage mode described in above-mentioned steps S181 to S183, prediction storage position is divided into multiple independent storage
Region, often newly-increased tuner driver, then take and a memory area stores this newly-increased tuner driving journey
Sequence.
In another feasible embodiment of the application, described in above-mentioned steps S18 by the performed driving after described compiling
Program is stored in described preset memory locations, specifically may comprise steps of:
S184, determine described current driver storage position, last position in described preset memory locations;
S185, with the next storage position of storage position, position, described end as start bit, write performing after described compiling successively
The data that driver is corresponding.
Different from above-mentioned steps S181 to S183, step S184 to S185 uses Coutinuous store mode, at existing tune
Behind last storage position, position shared by humorous device driver, write the data that newly-increased tuner driver is corresponding successively;
This mode can more make full use of memory space.
In one feasible embodiment of the application, the tuner detecting described TV motherboard described in above-mentioned steps S15 connects
Whether the tuner that mouth connects is changed, and specifically may comprise steps of:
S151, the chip type that the tuner of the tuner interface connection obtaining described TV motherboard is corresponding identify;
S152, by described chip type mark and preset kind mark compare;
If S153 described chip type mark is inconsistent with preset kind mark, it is determined that be configured with new in TV motherboard
Model tuner.
By above-mentioned detecting step, find whether the tuner in TV motherboard is changed in time, find newly-increased tuning in time
Device, and add corresponding tuner driver, it is to avoid the tuner matched because of the tuner after lacking and changing drives
Program and cause tuner the most correctly not initialize, and then affect the normal work of TV motherboard.
It addition, the embodiment of the present application additionally provides a kind of computer-readable storage medium, such as, can be that ROM, random access memory are deposited
Reservoir (RAM), CD-ROM, tape, floppy disk and optical data storage devices etc.;In this computer-readable storage medium, storage has journey
Sequence, when the program in described storage medium is performed by the processor of TV motherboard, it is possible to achieve implemented by said method
Any one tuner described in example drives the part or all of step in control method to drive tuner in TV motherboard
Dynamic control.
Driving control method corresponding to above-mentioned tuner, the embodiment of the present application additionally provides a kind of tuner and drives control dress
Putting, Fig. 4 is the structured flowchart of this device.With reference to Fig. 4, this device includes: compliance detection unit 100, ID obtain
Unit 200, target program are searched unit 300 and drive performance element 400.
Wherein, this compliance detection unit 100 is used for, it is judged that the tune that in described TV motherboard, tuner interface currently runs
The target tuner whether humorous device driver is currently connected with described tuner interface is compatible.
This ID acquiring unit 200 is used for, when described current operation tuner driver and described target tuner not
Time compatible, from the default bus that TV motherboard connects, obtain the Identity Code ID of described target tuner.
This target program is searched unit 300 and is used for, and searches the target drives corresponding with described ID from preset memory locations
Program.
This driving performance element 400 is used for, and described target tuner is carried out by the described target drives program according to finding
Initialize.
From above technical scheme, the driving means that the embodiment of the present application provides tunes in described TV motherboard being detected
When target tuner that the tuner driver that device interface currently runs currently is connected with described tuner interface is incompatible,
First pass through from the default bus that TV motherboard connects, obtain the ID value that target tuner is corresponding, then in default storage position
Put and collect the target drives program corresponding with this ID value of searching, this target drives program namely match with target tuner
Driver, thus call this target drives program, the driving to target tuner can be completed.Relative to prior art,
The embodiment of the present application can realize the same edition system driver compatibility Multiple Type tuner of TV motherboard, it is not necessary to
Develop respectively for every kind of model tuner and safeguard a kind of system driver version, such that it is able to be substantially reduced driving journey
Sequence exploitation and maintenance workload.
Ginseng Fig. 5, in one feasible embodiment of the application, the above-mentioned dynamic control device that drives can also include: interface is examined
Survey unit 500, source code acquiring unit 600, source code compilation unit 700 and program writing unit 800.
Wherein, interface detector unit 500 is configured to, and detects the tuner that the tuner interface of described TV motherboard connects
Whether change.
Source code acquiring unit 600 is configured to, detect described TV motherboard tuner interface connect tuner more
When changing, obtain the driver source code that the tuner after changing is corresponding.
Source code compilation unit 700 is configured to, and is compiled as performing driver by described driver source code.
Program writing unit 800 is configured to, and the performed driver after described compiling is stored in described default storage
Position.
Visible, the embodiment of the present application can detect whether the tuner of TV motherboard is changed in real time, obtains the tuning after changing
The driver source code that device is corresponding, is compiled this driver source code, and the performed driving described compiling obtained
Program is stored in described preset memory locations, such that it is able to get newly-increased tuner pair at any time from preset memory locations
The driver answered.
In one feasible embodiment of the application, said procedure writing unit 800 specifically can be configured to:
Determine that described current driver is corresponding in described preset memory locations and take memory area;
The reserved isolated area after memory area will have been taken as target storage described in described preset memory locations
Territory, and the performed driver after writing described compiling in territory, described target storage.
According to said procedure writing unit configuration mode, the program memory system realized is, is divided prediction storage position
For multiple independent memory areas, often newly-increased tuner driver, then take that to store this in a memory area new
The tuner driver increased, the tuner driver that will increase newly is stored in the parallel position of original tuner driver
Put, can be so that centralized maintenance.
In another feasible embodiment of the application, said procedure writing unit 800 is also configured as following form:
Determine described current driver storage position, last position in described preset memory locations, and with storage position, position, described end
Next storage position be start bit, write the data that the performed driver after described compiling is corresponding successively.
Said procedure writing unit configuration mode, the program memory system realized is, Coutinuous store mode, existing
Behind last storage position, position shared by tuner driver, write the number that newly-increased tuner driver is corresponding successively
According to;This mode can more make full use of memory space.
In one feasible embodiment of the application, above-mentioned interface detector unit 500 specifically can be configured to:
The chip type that the tuner of the tuner interface connection obtaining described TV motherboard is corresponding identifies, and by described chip
Type identification and preset kind mark are compared, if described chip type mark is inconsistent, then with preset kind mark
Determine and TV motherboard is configured with new model tuner.
The embodiment of the present application passes through interface detector unit, can find whether the tuner in TV motherboard is changed in time, and
The tuner that Shi Faxian is newly-increased, and add corresponding tuner driver, it is to avoid because of lack with replacing after tuner phase
The tuner driver of coupling and cause tuner the most correctly not initialize, and then affect the normal work of TV motherboard
Make.
Each embodiment in this specification all uses the mode gone forward one by one to describe, identical similar part between each embodiment
Seeing mutually, what each embodiment stressed is the difference with other embodiments.Especially for device
For system embodiment, owing to it is substantially similar to embodiment of the method, so describe is fairly simple, relevant part ginseng
See that the part of embodiment of the method illustrates.
Invention described above embodiment, is not intended that limiting the scope of the present invention.Any the present invention's
Amendment, equivalent and the improvement etc. made within spirit and principle, should be included within the scope of the present invention.