Drive binding method, device, electronic device and storage medium

By obtaining and dynamically binding the driver information of the audio processing device, the problem of lack of compatibility of Codec driver binding in the embedded Linux system is solved, automatic adaptation is realized when replacing the Codec driver, and the code does not need to be modified, which improves the compatibility of the system. performance and portability.

CN113741856BActive Publication Date: 2024-09-06FIBOCOM AUTO INC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110855343.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-07-27
Publication Date
2024-09-06
Estimated Expiration
2041-07-27

AI Technical Summary

Technical Problem

The Codec driver binding method in embedded Linux systems lacks compatibility, which results in the need to modify the Machine driver code when replacing the Codec driver, affecting flexibility and maintainability.

Method used

By obtaining the driver information of the target codec connected to the audio processing device, dynamically binding the driver and codec driver corresponding to the audio processing device, only updating the codec driver information in the data set without modifying the code of the audio processing device.

Benefits of technology

It improves the compatibility and portability of audio processing device drivers, simplifies the Codec driver replacement process, and reduces the complexity of development and maintenance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113741856B
    Figure CN113741856B
Patent Text Reader

Abstract

The present application relates to a driver binding method, device, electronic device and storage medium. The driver binding method comprises: obtaining driver information of a target codec connected to an audio processing device; and binding a driver corresponding to the audio processing device and a driver corresponding to the target codec according to the driver information. The compatibility of the driver corresponding to the audio processing device is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a driver binding method, device, electronic device and storage medium. Background Art

[0002] Advanced Linux Sound Architecture (ALSA) provides support for audio and Musical Instrument Digital Interface (MIDI) on the Linux operating system. The embedded Linux audio subsystem (ALSA System on Chip, ASOC) is a software system built on the standard ALSA driver layer to better support audio codecs (Codecs) in embedded processors and mobile devices. It contains three modules: Platform, Machine, and Codec. Machine refers to a certain machine, which can be a certain device, a certain development board, or a certain smartphone. Machine provides a carrier for CPU, Codec, input and output devices. The Machine driver is responsible for processing some machine-specific controls and audio events. The separate Platform and Codec drivers cannot work. They must be combined by the Machine driver to complete the audio processing of the entire device.

[0003] The current method of binding a Codec driver used by embedded Linux systems is to bind a specific Codec driver in the Machine code. By default, a Machine driver can only run a specific Codec driver. If you change to another Codec driver, you must change the code of the Machine driver, which lacks compatibility. Summary of the invention

[0004] In view of the above-mentioned deficiencies in the prior art, the purpose of the present application is to provide a driver binding method, device, electronic device and storage medium, aiming to solve the problem of lack of compatibility of Machine drivers.

[0005] In a first aspect, an embodiment of the present application provides a driver binding method, comprising:

[0006] Acquire driving information of a target codec connected to the audio processing device;

[0007] According to the driver information, a driver corresponding to the audio processing device and a driver corresponding to the target codec are bound.

[0008] In the embodiment of the present application, the driver information of the target codec connected to the audio processing device is first obtained, and then the driver corresponding to the audio processing device and the driver corresponding to the target codec are bound according to the obtained driver information. When the codec driver is replaced, the driver corresponding to the audio processing device and the driver corresponding to the codec connected to the audio processing device can be automatically bound according to the hardware situation, without modifying the code of the driver corresponding to the audio processing device, thereby improving the compatibility of the driver corresponding to the audio processing device.

[0009] In an implementation of the first aspect, the acquiring driving information of a target codec connected to the audio processing device includes:

[0010] The driving information of the target codec connected to the audio processing device is read from a data set of the audio processing device; the data set includes driving information of one or more codecs.

[0011] In the embodiment of the present application, the driving information of the codec connected to the audio processing device is read from the data set of the audio processing device, and the driver corresponding to the audio processing device and the driver of the codec connected to the audio processing device are bound to complete the binding of the codec driver. When replacing the codec driver, only the driving information of the codec in the data set of the audio processing device needs to be modified, and there is no need to modify the code of the driver corresponding to the audio processing device, thereby improving the compatibility and portability of the driver corresponding to the audio processing device.

[0012] In a possible implementation manner, before reading the driving information of the target codec connected to the audio processing device from the data set of the audio processing device, the method further includes:

[0013] Reading a first identifier of a first codec from the data set; the first codec is any one of the one or more codecs;

[0014] Reading a second identifier from a target register corresponding to the first codec;

[0015] When the first identifier is the same as the second identifier, the first codec is determined as the target codec.

[0016] In the embodiment of the present application, the first identifier of the first codec is read from the data set, and the second identifier is read from the target register corresponding to the first codec. When the first identifier and the second identifier are the same, it is determined that the first codec is connected to the audio processing device in hardware, and the first codec is determined as the target codec to bind the driver corresponding to the audio processing device and the driver corresponding to the first codec. The driver corresponding to the audio processing device and the driver corresponding to the first codec are bound using the information of the first codec stored in the data set. For a single codec, it is only necessary to add the hardware information and driver information of the codec to the data set to realize the dynamic binding of the driver corresponding to the codec, which is convenient for the replacement and modification of the codec driver.

[0017] In a possible implementation manner, reading the second identifier from a target register corresponding to the first codec includes:

[0018] The second identifier is read from a target register corresponding to the first codec via an I2C bus.

[0019] In the embodiment of the present application, the second identifier is read from the target register corresponding to the first codec via the I2C bus, and only two lines are needed to realize data transmission between the audio processing device and the first codec, thus saving costs.

[0020] In an implementation of the first aspect, the driver information includes a driver identifier of the target codec; and binding a driver corresponding to the audio processing device and a driver corresponding to the target codec according to the driver information includes:

[0021] Determining the driver corresponding to the target codec according to the driver identifier;

[0022] Bind a driver corresponding to the audio processing device and a driver corresponding to the target codec.

[0023] In an implementation of the first aspect, binding a driver corresponding to the audio processing device and a driver corresponding to the target codec includes:

[0024] The driver identifier is assigned to a configuration field of a connection structure in a driver corresponding to the audio processing device.

[0025] In the embodiment of the present application, the binding relationship between the audio processing device driver and the codec driver is described by the connection structure in the driver corresponding to the audio processing device. The binding between the driver corresponding to the audio processing device and the driver corresponding to the target codec can be completed by simply assigning the driver identifier of the target codec read from the data set to the configuration field of the connection structure in the driver corresponding to the audio processing device, thereby improving the binding efficiency.

[0026] In a second aspect, an embodiment of the present application provides a drive binding device, including:

[0027] An acquisition unit, used for acquiring driving information of a target codec connected to the audio processing device;

[0028] A binding unit is used to bind the driver corresponding to the audio processing device and the driver corresponding to the target codec according to the driver information.

[0029] In an implementation of the second aspect, the acquisition unit is specifically configured to read driving information of the target codec connected to the audio processing device from a data set of the audio processing device; the data set includes driving information of one or more codecs.

[0030] In an implementation of the second aspect, the drive binding device further includes:

[0031] A first reading unit, configured to read a first identifier of a first codec from the data set; the first codec is any one of the one or more codecs;

[0032] A second reading unit, configured to read a second identifier from a target register corresponding to the first codec;

[0033] The first determining unit is configured to determine the first codec as the target codec when the first identifier is the same as the second identifier.

[0034] In an implementation manner of the second aspect, the second reading unit is specifically configured to read the second identifier from a target register corresponding to the first codec through an I2C bus.

[0035] In an implementation of the second aspect, the driver information includes a driver identifier of the target codec, and the binding unit is specifically used to determine a driver corresponding to the target codec according to the driver identifier; and bind the driver corresponding to the audio processing device and the driver corresponding to the target codec.

[0036] In an implementation of the second aspect, the binding unit is specifically configured to assign the driver identifier to a configuration field of a connection structure in a driver corresponding to the audio processing device.

[0037] In the embodiments of the present application, the various units in the provided device can be separately or completely combined into one or more other units to constitute, or one (or more) of the units can be further divided into multiple smaller functional units to constitute, which can achieve the same operation without affecting the realization of the technical effects of the embodiments of the present application. The above units are divided based on logical functions. In practical applications, the functions of one unit can also be implemented by multiple units, or the functions of multiple units can be implemented by one unit.

[0038] In a third aspect, an embodiment of the present application provides an electronic device, comprising a processor and a memory, wherein the memory is used to store one or more programs, and the one or more programs are configured to be executed by the processor, and the program includes instructions for executing some or all of the steps described in the first aspect of the embodiment of the present application.

[0039] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the processor causes the processor to perform some or all of the steps described in the first aspect of the embodiment of the present application.

[0040] In the embodiment of the present application, the driver identification of the codec connected to the audio processing device is read from the data set of the audio processing device, and the driver identification corresponding to the audio processing device and the driver identification of the codec connected to the audio processing device are bound to complete the binding of the codec driver. When replacing the codec driver, only the driver identification of the codec in the data set of the audio processing device needs to be modified, and there is no need to modify the code of the audio processing device driver, thereby improving the compatibility and portability of the audio processing device driver. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] Figure 1 An ASOC architecture diagram provided for an embodiment of the present application;

[0042] Figure 2 A schematic diagram of a process flow of a driver binding method provided in an embodiment of the present application;

[0043] Figure 3 A flowchart of another driver binding method provided in an embodiment of the present application;

[0044] Figure 4 A schematic diagram of the structure of a drive binding device provided in an embodiment of the present application;

[0045] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0046] In order to facilitate the understanding of the present application, the present application will be described more fully below with reference to the relevant drawings. The preferred embodiments of the present application are given in the drawings. However, the present application can be implemented in many different forms and is not limited to the embodiments described herein. On the contrary, the purpose of providing these embodiments is to make the disclosure of the present application more thoroughly and comprehensively understood.

[0047] The terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices.

[0048] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit this application.

[0049] The present application provides a driver binding method. In order to more clearly describe the solution of the present application, some knowledge related to audio processing is first introduced below.

[0050] Advanced Linux Sound Architecture (ALSA): Provides support for audio and Musical Instrument Digital Interface (MIDI) on the Linux operating system.

[0051] Embedded Linux Audio Subsystem (ALSA System on Chip, ASOC): It is a software system built on the standard ALSA driver layer to better support the audio codec (Audio Codec) in embedded processors and mobile devices.

[0052] I2C bus: It is a simple, bidirectional, two-wire synchronous serial bus developed by Philips. Information transmission between devices connected to the bus is achieved through serial data lines and serial clock lines. The master device is used to start the bus to transmit data and generate a clock to open the transmitting device. At this time, any addressed device is considered a slave device. The relationship between the master and slave, send and receive on the bus is not constant, but depends on the data transmission direction at this time. If the host wants to send data to the slave device, the host first addresses the slave device, then actively sends data to the slave device, and finally the host terminates the data transmission; if the host wants to receive data from the slave device, the master device first addresses the slave device, then the host receives the data sent by the slave device, and finally the host terminates the receiving process. In this case, the host is responsible for generating a timing clock and terminating data transmission.

[0053] The architecture of ASOC is as follows Figure 1 As shown in the figure, ASOC contains three modules: Platform, Machine and Codec. Machine refers to a certain machine, which can be a certain device, a certain development board, or a certain smart phone. Machine provides a carrier for the central processing unit (CPU), Codec, and input and output devices. The Machine driver is responsible for handling some machine-specific controls and audio events. Platform generally refers to a system-on-chip (SoC) platform. Audio-related usually includes the clock, direct memory access (DMA) channel, integrated circuit built-in audio bus (I2S), pulse code modulation (PCM) interface, etc. in the SoC. The Platform driver includes the configuration and control of the audio DMA and audio interface of the SoC platform (I2S, PCM, etc.). Codec is a codec, which includes an I2S interface, a digital-to-analog converter, an analog-to-digital converter, a mixer, a power amplifier, and usually multiple inputs and multiple outputs. The Codec driver includes some audio controls, audio interfaces, the definition of dynamic audio power management, and the input and output functions of the Codec. Individual Platform and Codec drivers will not work; they must be combined by the Machine driver to complete the audio processing of the entire device.

[0054] By default, a Machine driver can only run one specific Codec driver. If you change to another Codec driver, you must change the code of the Machine driver. For example, if the Codec used by hardware A is MAX9867 and the Codec used by hardware B is NAU88U10, to drive hardware A and hardware B, you need to compile two versions of the Machine driver to run different Codec drivers, which lacks compatibility and flexibility and is not easy to maintain.

[0055] Based on this, the present application hopes to provide a solution that can solve the above-mentioned technical problems, the details of which will be described in the subsequent embodiments.

[0056] See also Figure 2 , Figure 2 A schematic diagram of a driver binding method provided in an embodiment of the present application. Figure 2 As shown, the driver binding method includes the following steps.

[0057] 201, obtaining driving information of a target codec connected to an audio processing device.

[0058] The electronic device obtains the driving information of the target codec connected to the audio processing device, where the target codec is a codec connected to the audio processing device in hardware. The electronic device obtains the driving information of the target codec to bind the driver corresponding to the audio processing device and the driver corresponding to the target codec according to the driving information.

[0059] Furthermore, the driving information of the target codec connected to the audio processing device can be read from the data set of the audio processing device. The data set of the audio processing device includes the driving information of one or more codecs, and the one or more codecs include the target codec. The data set can be a structure array, which is used to store the hardware information of different codecs. Each structure in the structure array stores the hardware information of a codec, and the hardware information of the codec can include the bus information, device address, register address and driving information of the codec.

[0060] In an embodiment of the present application, the hardware information of the codec that can be connected to the above-mentioned audio processing device is saved in a data set in advance. When binding the driver corresponding to the audio processing device and the driver of the codec, the driver information of the target codec connected to the audio processing device is obtained from the data set to bind the driver corresponding to the audio processing device and the driver corresponding to the target codec, so that the audio processing device can drive the target codec.

[0061] In the embodiment of the present application, the driving information of the codec connected to the audio processing device is read from the data set of the audio processing device, and the driver corresponding to the audio processing device and the driver of the codec connected to the audio processing device are bound to complete the binding of the codec driver. When replacing the codec driver, only the driving information of the codec in the data set of the audio processing device needs to be modified, and there is no need to modify the code of the driver corresponding to the audio processing device, thereby improving the compatibility and portability of the driver corresponding to the audio processing device.

[0062] In one implementation, before reading the driver information of the target codec connected to the audio processing device from the data set of the audio processing device, the driver binding method may further include the following steps:

[0063] (11) reading a first identifier of a first codec from the data set; the first codec is any one of the one or more codecs;

[0064] (12) reading a second identifier from a target register corresponding to the first codec;

[0065] (13) When the first identifier is the same as the second identifier, the first codec is determined as the target codec.

[0066] Specifically, the first codec is any one of the one or more codecs, and the first identifier is used to verify the identity of the first codec. The first identifier of the first codec is pre-saved in the data set to verify the first codec. During the driver binding process, the first identifier of the first codec is obtained from the data set, and the second identifier is read from the target register corresponding to the first codec. When the first identifier and the second identifier are the same, it means that the first codec is connected to the audio processing device in hardware, and the first codec is determined as the target codec.

[0067] Further, the bus information, device address and register address of the first codec can be obtained from the above data set, and the bus information is used to indicate the I2C bus mounted by the first codec. The bus information, device address and register address of the first codec are obtained from the data set, and the target register corresponding to the first codec is determined by the bus information, device address and register address of the first codec, and the second identifier is read from the target register through the I2C bus. Specifically, the corresponding I2C controller is obtained using the bus information, and the I2C information transmission structure is filled with the device address and register address, and then the Linux interface function is called to implement data transmission on the I2C bus, and the second identifier is read from the target register. The second identifier read from the register is compared with the first identifier read from the data set. If the first identifier is the same as the second identifier, it means that the first codec is connected to the audio processing device in hardware, and the first codec is determined as the target codec. The second identifier can be the value of the target register, that is, the value of the target register is obtained through the I2C bus to obtain the second identifier.

[0068] In the embodiment of the present application, the second identifier is read from the target register corresponding to the first codec via the I2C bus, and only two lines are needed to realize data transmission between the audio processing device and the first codec, thus saving costs.

[0069] 202 : Bind a driver corresponding to the audio processing device and a driver corresponding to the target codec according to the driver information.

[0070] After the electronic device obtains the driving information of the target codec connected to the audio processing device, the electronic device binds the driver corresponding to the audio processing device and the driver corresponding to the target codec according to the obtained driving information.

[0071] Specifically, the driving information includes a driving identifier, and the electronic device drives a driver corresponding to the target codec according to the driving identifier of the target codec, and binds the driver corresponding to the audio processing device and the driver corresponding to the target codec.

[0072] In the embodiment of the present application, the driver information of the target codec connected to the audio processing device is first obtained, and then the driver corresponding to the audio processing device and the driver corresponding to the target codec are bound according to the obtained driver information. When the codec driver is replaced, the driver corresponding to the audio processing device and the driver corresponding to the codec connected to the audio processing device can be automatically bound according to the hardware situation, without modifying the code of the driver corresponding to the audio processing device, thereby improving the compatibility of the driver corresponding to the audio processing device.

[0073] In one implementation, the above-mentioned binding of the driver corresponding to the audio processing device and the driver corresponding to the target codec may include the following steps:

[0074] The driver identifier is assigned to a configuration field of a connection structure in a driver corresponding to the audio processing device.

[0075] Specifically, the driver corresponding to the audio processing device includes a connection structure, and the connection structure is used to describe the connection relationship between the driver corresponding to the audio processing device and the driver corresponding to the target codec. The driver identifier of the target codec is read from the data set, the driver corresponding to the target codec is determined according to the driver identifier, and the driver identifier of the target codec is assigned to the configuration field corresponding to the connection structure in the driver corresponding to the audio processing device, thereby completing the binding of the driver corresponding to the audio processing device and the driver of the codec.

[0076] The above data set also includes the digital audio interface identifier of the target codec. While reading the driver identifier of the target codec from the data set, the digital audio interface identifier of the target codec can also be read from the data set, and the digital audio interface identifier is assigned to the configuration field corresponding to the link structure in the driver corresponding to the audio processing device.

[0077] The above-mentioned audio processing device and codec can specifically be the Machine and Codec in ASOC. The Machine driver is responsible for binding the Platform driver and the Codec driver to register the sound card device. When the Machine driver matches the corresponding Machine device, start the Machine driver initialization program to bind the Codec driver. Obtain the first identifier, bus information, device address and register address of the Codec from the data set, and use the bus information, device address and register address of the Codec to read the second identifier from the target register corresponding to the Codec. Then compare the first identifier with the second identifier. If the first identifier is the same as the second identifier, determine that the Codec is connected to the Machine in hardware, obtain the Codec's driver identifier and digital audio interface identifier from the data set, and assign the Codec's driver identifier and digital audio interface identifier to the corresponding configuration fields in the connection structure snd_soc_dai_link in the Machine driver to complete the binding of the Codec driver.

[0078] In the embodiment of the present application, the binding relationship between the audio processing device driver and the codec driver is described by the connection structure in the driver corresponding to the audio processing device. The binding between the driver corresponding to the audio processing device and the driver corresponding to the target codec can be completed by simply assigning the driver identifier of the target codec read from the data set to the configuration field of the connection structure in the driver corresponding to the audio processing device, thereby improving the efficiency of driver binding.

[0079] In the embodiment of the present application, the driver information of the target codec connected to the audio processing device is first obtained, and then the driver corresponding to the audio processing device and the driver corresponding to the target codec are bound according to the obtained driver information. When the codec driver is replaced, the driver corresponding to the audio processing device and the driver corresponding to the codec connected to the audio processing device can be automatically bound according to the hardware situation, without modifying the code of the driver corresponding to the audio processing device, thereby improving the compatibility of the driver corresponding to the audio processing device.

[0080] See also Figure 3 , Figure 3 A flowchart of another driver binding method provided in an embodiment of the present application is shown below. Figure 3 As shown, the driver binding method includes the following steps.

[0081] 301. Read a first identifier of a first codec from a data set of an audio processing device.

[0082] Specifically, the data set of the audio processing device includes hardware information of multiple codecs, the first codec is any one of the multiple codecs, and the hardware information includes a first identifier. The first identifier is used to verify the identity of the first codec, and the first identifier can be specifically the value of the register of the first codec. Because the data set of the audio processing device includes hardware information of one or more codecs, and it is necessary to bind the driver corresponding to each codec corresponding to the hardware information stored in the data set and the driver corresponding to the audio processing device, in order to make the description more convenient and concise, the embodiment of the present application will randomly extract a codec from the multiple codecs corresponding to the hardware information stored in the data set as the first codec, and then take the binding of the driver corresponding to the first codec as an example for description, wherein the first codec is any one of the multiple codecs corresponding to the hardware information stored in the data set.

[0083] 302: Read a second identifier from a register corresponding to the first codec.

[0084] Specifically, the hardware information also includes bus information, device address and register address. The bus information, device address and register address of the first codec are read from the data set, and the second identifier is read from the register corresponding to the first codec according to the bus information, device address and register address. The second identifier can be specifically the value of the register corresponding to the first codec.

[0085] 303: When the first identifier and the second identifier are the same, determine that the first codec is connected to the audio processing device.

[0086] Specifically, when the first identifier and the second identifier are the same, it means that the first codec described by the data set is the same as the codec connected to the hardware, and it is determined that the first codec is connected to the audio processing device in hardware.

[0087] When the first identifier and the second identifier are different, it means that the first codec described by the data set is different from the codec connected to the hardware, and it is determined that the first codec is not connected to the audio processing device in hardware, and the driver corresponding to the first codec and the driver corresponding to the audio processing device are not bound. The first identifier of the second codec is read from the data set to bind the driver corresponding to the second codec and the driver corresponding to the audio processing device, and the second codec is any one of the multiple codecs corresponding to the hardware information stored in the data set except the first codec.

[0088] 304, obtaining driving information of the first codec from the data set.

[0089] 305 : Bind a driver corresponding to the audio processing device and a driver corresponding to the first codec according to the driver information.

[0090] The specific description of the above steps 304 and 305 can refer to the above Figure 2 The corresponding steps of the described driver binding method will not be repeated here.

[0091] In an embodiment of the present application, a first identifier of a first codec is read from a data set, and a second identifier is read from a target register corresponding to the first codec. When the first identifier and the second identifier are the same, it is determined that the first codec is connected to the audio processing device in hardware, and a driver corresponding to the audio processing device and a driver corresponding to the first codec are bound. The driver corresponding to the audio processing device and the driver corresponding to the first codec are bound using the information of the first codec stored in the data set. For a single codec, it is only necessary to add the hardware information and driver information of the codec to the data set to realize dynamic binding of the driver corresponding to the codec, which facilitates the replacement and modification of the codec driver.

[0092] See also Figure 4 , Figure 4 This is a schematic diagram of the structure of a drive binding device provided in an embodiment of the present application. Figure 4 As shown, the drive binding device 40 includes an acquisition unit 401 and a binding unit 402 .

[0093] The acquisition unit 401 is used to acquire driving information of a target codec connected to the audio processing device.

[0094] The binding unit 402 is used to bind the driver corresponding to the audio processing device and the driver corresponding to the target codec according to the driver information.

[0095] In the embodiment of the present application, the driver information of the target codec connected to the audio processing device is first obtained, and then the driver corresponding to the audio processing device and the driver corresponding to the target codec are bound according to the obtained driver information. When the codec driver is replaced, the driver corresponding to the audio processing device and the driver corresponding to the codec connected to the audio processing device can be automatically bound according to the hardware situation, without modifying the code of the driver corresponding to the audio processing device, thereby improving the compatibility of the driver corresponding to the audio processing device.

[0096] In one implementation, the acquisition unit 401 is specifically configured to read the driving information of the target codec connected to the audio processing device from the data set of the audio processing device; the data set includes driving information of one or more codecs.

[0097] In the embodiment of the present application, the driving information of the codec connected to the audio processing device is read from the data set of the audio processing device, and the driver corresponding to the audio processing device and the driver of the codec connected to the audio processing device are bound to complete the binding of the codec driver. When replacing the codec driver, only the driving information of the codec in the data set of the audio processing device needs to be modified, and there is no need to modify the code of the driver corresponding to the audio processing device, thereby improving the compatibility and portability of the driver corresponding to the audio processing device.

[0098] In one embodiment, the drive binding device 40 further includes:

[0099] A first reading unit 403 is used to read a first identifier of a first codec from the data set; the first codec is any one of the one or more codecs mentioned above;

[0100] A second reading unit 404, configured to read a second identifier from a target register corresponding to the first codec;

[0101] The first determining unit 405 is configured to determine the first codec as the target codec when the first identifier is the same as the second identifier.

[0102] In the embodiment of the present application, the first identifier of the first codec is read from the data set, and the second identifier is read from the target register corresponding to the first codec. When the first identifier and the second identifier are the same, it is determined that the first codec is connected to the audio processing device in hardware, and the first codec is determined as the target codec to bind the driver corresponding to the audio processing device and the driver corresponding to the first codec. The driver corresponding to the audio processing device and the driver corresponding to the first codec are bound using the information of the first codec stored in the data set. For a single codec, it is only necessary to add the hardware information and driver information of the codec to the data set to realize the dynamic binding of the driver corresponding to the codec, which is convenient for the replacement and modification of the codec driver.

[0103] In one implementation, the second reading unit 404 is specifically configured to read the second identifier from a target register corresponding to the first codec via an I2C bus.

[0104] In the embodiment of the present application, the second identifier is read from the target register corresponding to the first codec via the I2C bus, and only two lines are needed to realize data transmission between the audio processing device and the first codec, thus saving costs.

[0105] In one implementation, the driver information includes a driver identifier of the target codec, and the binding unit 402 is specifically configured to determine a driver corresponding to the target codec according to the driver identifier; and bind the driver corresponding to the audio processing device to the driver corresponding to the target codec.

[0106] In one implementation, the binding unit 402 is specifically configured to assign the driver identifier to a configuration field of a connection structure in a driver corresponding to the audio processing device.

[0107] In the embodiment of the present application, the binding relationship between the audio processing device driver and the codec driver is described by the connection structure in the driver corresponding to the audio processing device. The binding between the driver corresponding to the audio processing device and the driver corresponding to the target codec can be completed by simply assigning the driver identifier of the target codec read from the data set to the configuration field of the connection structure in the driver corresponding to the audio processing device, thereby improving the efficiency of driver binding.

[0108] See also Figure 5 , Figure 5A schematic diagram of the structure of an electronic device 50 provided in an embodiment of the present application. The electronic device 50 may include a memory 501 and a processor 502. Further optionally, it may also include a communication interface 503 and a bus 504, wherein the memory 501, the processor 502 and the communication interface 503 are connected to each other through the bus 504. The communication interface 503 is used to perform data interaction with the above-mentioned drive binding device 30.

[0109] The memory 501 is used to provide a storage space, in which data such as an operating system and a computer program can be stored. The memory 501 includes, but is not limited to, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), or a portable read-only memory (CD-ROM).

[0110] The processor 502 is a module that performs arithmetic operations and logical operations, and may be one or a combination of multiple processing modules such as a central processing unit (CPU), a graphics processing unit (GPU), or a microprocessor unit (MPU).

[0111] The memory 501 stores a computer program, and the processor 502 calls the computer program stored in the memory 501 to execute the above Figure 2 The driver binding method shown:

[0112] Acquire driving information of a target codec connected to the audio processing device;

[0113] According to the driver information, a driver corresponding to the audio processing device and a driver corresponding to the target codec are bound.

[0114] The specific content of the method executed by the processor 502 can be found in the above Figure 2 , I will not go into details here.

[0115] Accordingly, the processor 502 calls the computer program stored in the memory 501, and can also be used to execute the above Figure 4 The method steps performed by each unit in the drive binding device 40 shown in FIG. 4 are described in detail in the above Figure 4 , I will not go into details here.

[0116] exist Figure 4 In the described driver binding device 40, in the embodiment of the present application, the driver information of the target codec connected to the audio processing device is first obtained, and then the driver corresponding to the audio processing device and the driver corresponding to the target codec are bound according to the obtained driver information. When the codec driver is replaced, the driver corresponding to the audio processing device and the driver corresponding to the codec connected to the audio processing device can be automatically bound according to the hardware situation, without modifying the code of the driver corresponding to the audio processing device, thereby improving the compatibility of the driver corresponding to the audio processing device.

[0117] The present application also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program. When the computer program is executed on one or more processors, the above-mentioned Figure 2 The method shown.

[0118] The present application also provides a computer program product. When the computer program product is run on a processor, the above-mentioned Figure 2 The method shown.

[0119] The embodiment of the present application also provides a chip, which includes a processor and a communication interface, wherein the processor is used to call and run instructions from the communication interface, and when the processor executes the instructions, the above-mentioned Figure 2 The method shown.

[0120] An embodiment of the present application also provides a system, which includes at least one tender notice generating device 40 or electronic device 50 or chip as described above.

[0121] In summary, by implementing the driver binding method in the embodiment of the present application, the driver information of the target codec connected to the audio processing device is obtained, and the driver corresponding to the audio processing device and the driver corresponding to the target codec are bound according to the obtained driver information. When the codec driver is replaced, the driver corresponding to the audio processing device and the driver corresponding to the codec connected to the audio processing device can be automatically bound according to the hardware situation, without modifying the code of the driver corresponding to the audio processing device, thereby improving the compatibility of the driver corresponding to the audio processing device.

[0122] It should be understood that the application of the present application is not limited to the above examples. For ordinary technicians in this field, improvements or changes can be made based on the above description. All these improvements and changes should fall within the scope of protection of the claims attached to this application.

Claims

1. A driver binding method, characterized in that: The method comprises: Reading a first identifier of a first codec from a data set of an audio processing device; the data set includes driving information of one or more codecs, and the first codec is any one of the one or more codecs; Reading a second identifier from a target register corresponding to the first codec; When the first identifier is the same as the second identifier, determining the first codec as a target codec; Reading driving information of the target codec connected to the audio processing device from the data set; According to the driver information, a driver corresponding to the audio processing device and a driver corresponding to the target codec are bound.

2. The method according to claim 1, characterized in that The step of reading the second identifier from the target register corresponding to the first codec includes: The second identifier is read from a target register corresponding to the first codec via an I2C bus.

3. The method according to claim 1 or 2, characterized in that: The driving information includes a driving identifier of the target codec; The step of binding a driver corresponding to the audio processing device and a driver corresponding to the target codec according to the driver information includes: Determining the driver corresponding to the target codec according to the driver identifier; Bind a driver corresponding to the audio processing device and a driver corresponding to the target codec.

4. The method according to claim 3, characterized in that The step of binding the driver corresponding to the audio processing device and the driver corresponding to the target codec includes: The driver identifier is assigned to a configuration field of a connection structure in a driver corresponding to the audio processing device.

5. A drive binding device, characterized in that: include: A first reading unit is used to read a first identifier of a first codec from a data set of an audio processing device; the data set includes driving information of one or more codecs, and the first codec is any one of the one or more codecs; A second reading unit, configured to read a second identifier from a target register corresponding to the first codec; a first determining unit, configured to determine the first codec as a target codec when the first identifier is the same as the second identifier; an acquisition unit, configured to read, from the data set, driving information of the target codec connected to the audio processing device; A binding unit is used to bind the driver corresponding to the audio processing device and the driver corresponding to the target codec according to the driver information.

6. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory is used to store one or more programs, and the one or more programs are configured to be executed by the processor, wherein the program includes a program for executing the method according to any one of claims 1 to 4.

7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the processor is enabled to perform the method according to any one of claims 1 to 4.