Because of the holidays, TI E2E™ design support forum responses will be delayed from Dec. 25 through Jan. 2. Thank you for your patience.

This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

PCM9211: PCM9211 intel x86 driver

Part Number: PCM9211

Hi Guys, 

We are currently trying to port the PCM9211 driver on an Intel X86 platform.

So far we've made modifications to enable the driver to support ACPI.

Currently, the driver and ALSA-related modules are getting loaded into the kernel successfully,

Still, we don't see Linux showing up the sound card device such as /dev/snd/pcmC0D0c, /dev/snd/pcmC0D0p, etc.

We learned that Intel is currently using HDA (High Definition Audio) architecture to control a codec and to connect ALSA.

To properly function, the pcm9211 driver has to work with intel HDA requirements.

The current pcm9211 driver we have is for the ARM platform and does not fit the Intel HDA mechanism.

We need TI's help to modify or provide a new pcm9211 driver based on intel platform that can work with the Intel HDA mechanism.

Thanks, 

 

  • Have you used this code?  

    src - lpaa-android-drivers/pcmdevice-linux-driver - Unnamed repository; edit this file 'description' to name the repository.

    running following commands

    ls /sys/bus/i2c/devices/2- 0048 (2 is i2c bus no, 48 is the 7-bit i2c address)

    cat proc/asound/pcm

    cat proc/asound/cards

    Kindly share the ACPI table with me? And check whether the i2c_probe was called? 

  • Hi Shenghao I merged the pcmdevice code into our kernel source. After testing, I have three issues for the pcm driver:

    1. My previous ASL code is compatible with PCM9211 DT driver and is tested not working with the new PCMDEVICE driver. The new PCMDEVICE driver is for ACPI, so can you provide the corresponding ASL code?
    2. The PCMDEVICE driver needs a .bin firmware. Can you provide it or guide me how to build it?
    3. How to define PCM9211 related init parameters in ASL to pass into the driver. This issue is related to item 1

    Please advise... 

  • Hi Kashif

    #2 use regbin tool to generate bin file, which has already shared in pcmdeivce/tool.

    bin file name is pcm9211.bin. Our datasheet offers how to set the registers.

    #1 ~ #3 you can share the ASL code with me, I can leave some comments with you. One more thing, have you got the support platform vendor - Intel? I think they are the expert in the ASL code.

    BR

    Shenghao Ding

  • Hi Shenghao,

    To make pcm9211.bin, do you mean to follow RegBinFile - logo.pdf? But, we are using Intel Atom platform, so I didn't figure out how to configure registers.

    For the ASL, please check the following:

    DefinitionBlock ("pcm9211.aml", "SSDT", 2, "ATX", "DVIS2", 2)
    {
        External (_SB_.PCI0.I2C0, DeviceObj)
    
        Scope (\_SB.PCI0.I2C0)
        {
            Device (PCM) {
                Name (_HID, "PRP0001")
                Name (_CID, "pcm9211")
                Name (_DDN, "ATX Networks DVIS2")
                Name (_CRS, ResourceTemplate()
                {
                    I2cSerialBusV2 (
                        0x0040,              // I2C Slave Address
                        ControllerInitiated,
                        400000,              // Bus speed
                        AddressingMode7Bit,
                        "\\_SB.PCI0.I2C0",       // Link to ACPI I2C host contr oller
                        0,
                        ResourceConsumer, , Exclusive,
                    )
                    GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, IoRestrictionOutputOnly,
                        "\\_SB.GPO0", 0x00, ResourceConsumer)
                    {   // Pin# list (refer to #gpioinfo gpiochip0)
                        29,30,31,32,56,57,71,72  // pcm9211_1_int0, adv7482_1_rst, adv7482_2_rst, pcm9211_1_rst, pcm9211_2_rst
                    }
                    GpioInt (Edge, ActiveHigh, ExclusiveAndWake, PullDefault, 0x0000, 
                        "\\_SB.PCI0.GPO0", 0x00, ResourceConsumer)
                    {   // Pin# list (refer to #gpioinfo gpiochip0)
                        29      // pcm9211_1_int0, pcm9211_2_int0, pcm9211_1_int1, pcm9211_2_int2
                    }
                })
    
    	        Name (_DSD, Package() {
    		        ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),     // generic UUIDs defined by kernel
    		        Package () {
    		                Package () {"compatible", "ti,pcm9211"},
    		                Package () {"reg", 0x48},
    		                Package () {"reset-gpios", Package() {^PCM, 0, 6, 0}},
    		                				                    /* ref, idx, pin, active-high */
    		                Package () {"int0-gpios", Package() {^PCM, 0, 0, 0}},
    		                Package () {"ti,group-function", Package(3) {0, 3, 0}},
    		                Package () {"ti,mpio-b-flags-gpio", Package(4) {0, 0, 0, 0}},
    		                Package () {"ti,mpio-b-flag", Package(4) {14, 0, 0, 0}},
    		        },
    	        })
            }
        }
    }
    
    

  • Yes, we can set up a conf-call on how to.

  • Does the platform support I2S?

  • Name (_HID, "PRP0001")改成Name (_HID, "pcm9211")试一下

  • static int adv748x_parse_acpi(struct adv748x_state *state)
    {
    struct fwnode_handle *local_fwnode = NULL;
    struct fwnode_endpoint ep;
    bool out_found = false;
    bool in_found = false;

    fwnode_graph_for_each_endpoint(state->dev->fwnode, local_fwnode) {
    fwnode_graph_parse_endpoint(local_fwnode, &ep);
    adv_info(state, "Endpoint %p on port %d", local_fwnode, ep.port);

    if (ep.port >= ADV748X_PORT_MAX) {
    adv_err(state, "Invalid endpoint %p on port %d",
    ep.local_fwnode, ep.port);

    continue;
    }

    if (state->endpoints[ep.port]) {
    adv_err(state,
    "Multiple port endpoints are not supported");
    continue;
    }

    state->endpoints[ep.port] = &ep;

    /*
    * At least one input endpoint and one output endpoint shall
    * be defined.
    */
    if (ep.port < ADV748X_PORT_TXA)
    in_found = true;
    else
    out_found = true;
    }

    return in_found && out_found ? 0 : -ENODEV;
    }

  • DefinitionBlock ("adv7482.aml", "SSDT", 1, "TI", "ATX", 2)
    {
    External (_SB_.PCI0.I2C0, DeviceObj)

    Scope (\_SB.PCI0.I2C0)
    {
    Device (DVIS) {
    Name (_HID, "PRP0001")
    Name (_DDN, "ATX Networks DVIS2")
    Name (_CRS, ResourceTemplate()
    {
    I2cSerialBusV2 (
    0x0070, // I2C Slave Address
    ControllerInitiated,
    400000, // Bus speed
    AddressingMode7Bit,
    "\\_SB.PCI0.I2C0", // Link to ACPI I2C host contr oller
    0,
    ResourceConsumer, , Exclusive,
    )
    GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, IoRestrictionOutputOnly,
    "\\_SB.GPO0", 0x00, ResourceConsumer)
    { // Pin# list (refer to #gpioinfo gpiochip0)
    58,59,60,61,56,57 // adv7482_1_int1, adv7482_1_int2, adv7482_2_int1, adv7482_2_int2, adv7482_1_rst, adv7482_2_rst
    }
    Interrupt (ResourceConsumer, Level, ActiveLow, Exclusive)
    { // Pin# list (refer to #gpioinfo gpiochip0)
    30, 31 // pcm9211_1_int0, pcm9211_2_int0, pcm9211_1_int1, pcm9211_2_int2
    }
    })
    Name (_DSD, Package() {
    ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), // generic UUIDs defined by kernel
    Package () {
    Package () { "compatible", "adi,adv7482" },
    Package () { "reg", Package() { 0x70,0x71,0x72,0x73,0x74,0x75,0x60,0x61,0x62,0x63,0x64,0x65 } },
    Package () { "reg-names", Package() { "main","dpll","cp","hdmi","edid","repeater","inforframe","cbus","cec","sdp","txa","txb" } },
    Package () { "address-cells", 1 },
    Package () { "size-cells", 0 },
    Package () { "interrupt-names", Package() { "intrq1","intrq2" } },
    },
    ToUUID("dbb8e3e6-5886-4ba6-8795-1319f52a966b"), // subnodes UUIDs defined by kernel
    Package () {
    Package () { "port@1", "PRT1" },
    Package () { "port@2", "PRT2" },
    Package () { "port@3", "PRT3" },
    Package () { "port@4", "PRT4" },
    Package () { "port@8", "PRT8" },
    Package () { "port@a", "PRTA" },
    Package () { "port@b", "PRTB" },
    },
    })
    Name (PRT1, Package() {
    ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
    Package () {
    Package () { "reg", 1 },
    },
    ToUUID("dbb8e3e6-5886-4ba6-8795-1319f52a966b"),
    Package () {
    Package () { "endpoint@1", "EP10" },
    },
    })
    Name (EP10, Package() {
    ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
    Package () {
    Package () { "reg", 1 },
    Package () { "remote-endpoint", Package() {
    \_SB.PCI0.ISP,"port@1", "endpoint@1" }
    },
    }
    })

    Name (PRT2, Package() {
    ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
    Package () {
    Package () { "reg", 2 },
    },
    ToUUID("dbb8e3e6-5886-4ba6-8795-1319f52a966b"),
    Package () {
    Package () { "endpoint@2", "EP20" },
    },
    })
    Name (EP20, Package() {
    ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
    Package () {
    Package () { "reg", 2 },
    Package () { "remote-endpoint", Package() {
    \_SB.PCI0.ISP,"port@2", "endpoint@2" }
    },
    }
    })

    Name (PRT3, Package() {
    ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
    Package () {
    Package () { "reg", 3 },
    },
    ToUUID("dbb8e3e6-5886-4ba6-8795-1319f52a966b"),
    Package () {
    Package () { "endpoint@3", "EP30" },
    },
    })
    Name (EP30, Package() {
    ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
    Package () {
    Package () { "reg", 3 },
    Package () { "remote-endpoint", Package() {
    \_SB.PCI0.ISP,"port@3", "endpoint@3" }
    },
    }
    })

    Name (PRT4, Package() {
    ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
    Package () {
    Package () { "reg", 4 },
    },
    ToUUID("dbb8e3e6-5886-4ba6-8795-1319f52a966b"),
    Package () {
    Package () { "endpoint@4", "EP40" },
    },
    })
    Name (EP40, Package() {
    ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
    Package () {
    Package () { "reg", 4 },
    Package () { "remote-endpoint", Package() {
    \_SB.PCI0.ISP,"port@4", "endpoint@4" }
    },
    }
    })

    Name (PRT8, Package() {
    ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
    Package () {
    Package () { "reg", 8 },
    },
    ToUUID("dbb8e3e6-5886-4ba6-8795-1319f52a966b"),
    Package () {
    Package () { "endpoint@8", "EP80" },
    },
    })
    Name (EP80, Package() {
    ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
    Package () {
    Package () { "reg", 8 },
    Package () { "remote-endpoint", Package() {
    \_SB.PCI0.ISP,"port@8", "endpoint@8" }
    },
    }
    })

    Name (PRTA, Package() {
    ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
    Package () {
    Package () { "reg", 10 },
    },
    ToUUID("dbb8e3e6-5886-4ba6-8795-1319f52a966b"),
    Package () {
    Package () { "endpoint@a", "EPA0" },
    },
    })
    Name (EPA0, Package() {
    ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
    Package () {
    Package () { "reg", 10 },
    Package () { "clock-lanes", 0 },
    Package () { "data-lanes", Package() { 1, 2, 3, 4 } },
    Package () { "remote-endpoint", Package() {
    \_SB.PCI0.ISP,"port@a", "endpoint@a" }
    },
    }
    })

    Name (PRTB, Package() {
    ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
    Package () {
    Package () { "reg", 11 },
    },
    ToUUID("dbb8e3e6-5886-4ba6-8795-1319f52a966b"),
    Package () {
    Package () { "endpoint@b", "EPB0" },
    },
    })
    Name (EPB0, Package() {
    ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
    Package () {
    Package () { "reg", 11 },
    Package () { "clock-lanes", 0 },
    Package () { "data-lanes", 1 },
    Package () { "remote-endpoint", Package() {
    \_SB.PCI0.ISP,"port@b", "endpoint@b" }
    },
    }
    })
    }
    }

  • Which ubuntu 18.04 have you installed, desktop or server?

  • pcm9211.bin

    pcm9211-1pcs.json
    {
        "version": "1.3.6",
        "settings": {
            "configurationList": [
                {
                    "blocksList": [
                        {
                            "blockName": "PRE_SHUTDOWN - Dev 1",
                            "commands": [
                                {
                                    "book": "0",
                                    "page": "0",
                                    "register": "02",
                                    "mask": "ff",
                                    "data": "80",
                                    "delay": "",
                                    "$$hashKey": "05V"
                                }
                            ],
                            "blockType": "PRE_SHUTDOWN",
                            "deviceName": "Dev 1 - TAS2558",
                            "deviceValue": 1,
                            "deviceShortName": ""
                        },
                        {
                            "blockName": "PRE_POWER_UP - Dev 1",
                            "commands": [
                                {
                                    "book": "0",
                                    "page": "0",
                                    "register": "02",
                                    "mask": "ff",
                                    "data": "81",
                                    "delay": "",
                                    "$$hashKey": "064"
                                },
                                {
                                    "book": "0",
                                    "page": "0",
                                    "register": "0",
                                    "mask": "ff",
                                    "data": "",
                                    "delay": 1,
                                    "$$hashKey": "065"
                                },
                                {
                                    "book": "0",
                                    "page": "0",
                                    "register": "07",
                                    "mask": "ff",
                                    "data": "31",
                                    "delay": "",
                                    "$$hashKey": "066"
                                },
                                {
                                    "book": "0",
                                    "page": "0",
                                    "register": "08",
                                    "mask": "ff",
                                    "data": "01",
                                    "delay": "",
                                    "$$hashKey": "067"
                                },
                                {
                                    "book": "0",
                                    "page": "0",
                                    "register": "0b",
                                    "mask": "ff",
                                    "data": "0",
                                    "delay": "",
                                    "$$hashKey": "068"
                                },
                                {
                                    "book": "0",
                                    "page": "0",
                                    "register": "0c",
                                    "mask": "ff",
                                    "data": "1",
                                    "delay": "",
                                    "$$hashKey": "069"
                                },
                                {
                                    "book": "0",
                                    "page": "0",
                                    "register": "2b",
                                    "mask": "ff",
                                    "data": "30",
                                    "delay": "",
                                    "$$hashKey": "06A"
                                },
                                {
                                    "book": "0",
                                    "page": "0",
                                    "register": "3c",
                                    "mask": "ff",
                                    "data": "24",
                                    "delay": "",
                                    "$$hashKey": "06B"
                                },
                                {
                                    "book": "0",
                                    "page": "0",
                                    "register": "41",
                                    "mask": "ff",
                                    "data": "24",
                                    "delay": "",
                                    "$$hashKey": "06C"
                                },
                                {
                                    "book": "0",
                                    "page": "0",
                                    "register": "74",
                                    "mask": "ff",
                                    "data": "c0",
                                    "delay": "",
                                    "$$hashKey": "06D"
                                },
                                {
                                    "book": "0",
                                    "page": "0",
                                    "register": "75",
                                    "mask": "ff",
                                    "data": "60",
                                    "delay": "",
                                    "$$hashKey": "06E"
                                }
                            ],
                            "blockType": "PRE_POWER_UP",
                            "deviceName": "Dev 1 - TAS2558",
                            "deviceValue": 1,
                            "deviceShortName": ""
                        }
                    ],
                    "configName": "3 mic",
                    "blockTypeValues": {
                        "COEFF": "0x01",
                        "POST_POWER_UP": "0x02",
                        "PRE_SHUTDOWN": "0x03",
                        "PRE_POWER_UP": "0x04",
                        "POST_SHUTDOWN": "0x05"
                    },
                    "subBlockTypeValues": {
                        "SINGLE_BYTE_WRITES": "0x01",
                        "BURST_WRITES": "0x02",
                        "DELAY": "0x03",
                        "FIELD_WRITES": "0x04"
                    },
                    "$$hashKey": "04B"
                }
            ],
            "binConfig": {
                "headerSize": 292,
                "binaryVersion": [
                    0,
                    0,
                    1,
                    5
                ],
                "driverVersion": [
                    0,
                    0,
                    1,
                    1
                ],
                "maxConfigs": 64,
                "maxDevice": 8,
                "configNameLength": 64,
                "types": {
                    "deviceType": {
                        "availableDeviceTypes": [
                            "Integrated",
                            "Non Integrated"
                        ]
                    },
                    "platformType": {
                        "values": {
                            "QCom": "0x01",
                            "MTK": "0x02",
                            "LSI": "0x03"
                        },
                        "valueType": "int",
                        "length": 1
                    },
                    "deviceCount": {
                        "values": {
                            "1 Device": "0x01",
                            "2 Devices": "0x02",
                            "3 Device": "0x03",
                            "4 Devices": "0x04",
                            "5 Device": "0x05",
                            "6 Devices": "0x06",
                            "7 Devices": "0x07",
                            "8 Devices": "0x08"
                        },
                        "valueType": "int",
                        "length": 1
                    },
                    "amplifierType": {
                        "values": {
                            "TAS2558": "0x01",
                            "TAS2560": "0x02",
                            "TAS2562": "0x03",
                            "TAS2564": "0x04",
                            "TAS2783": "0x05"
                        },
                        "valueType": "int",
                        "length": 8
                    },
                    "blockType": {
                        "values": {
                            "COEFF": "0x01",
                            "POST_POWER_UP": "0x02",
                            "PRE_SHUTDOWN": "0x03",
                            "PRE_POWER_UP": "0x04",
                            "POST_SHUTDOWN": "0x05"
                        },
                        "valueType": "int",
                        "length": 1
                    },
                    "subBlockType": {
                        "values": {
                            "SINGLE_BYTE_WRITES": "0x01",
                            "BURST_WRITES": "0x02",
                            "DELAY": "0x03",
                            "FIELD_WRITES": "0x04"
                        },
                        "valueType": "int",
                        "length": 1
                    }
                }
            },
            "platformType": "MTK",
            "devicesCount": "1 Device",
            "amplifierType": [
                "TAS2558"
            ],
            "deviceType": "Non Integrated"
        }
    }