Skip to content

DynamicDevices/tasdevice-linux-driver

Repository files navigation

TAS Device Linux Driver

Linux kernel driver for Texas Instruments TAS audio amplifier chips (TAS5805, TAS5822, TAS6424, TAS6584, TAS5825).

Features

  • ASoC (ALSA System on Chip) integration
  • Support for multiple devices on the same I2C bus
  • Firmware-based configuration loading
  • Device Tree and ACPI support
  • Sysfs interface for debugging and configuration
  • IRQ handling for device status monitoring

Supported Devices

  • TAS5805M - Stereo digital input Class-D amplifier
  • TAS5822M - High efficiency digital input Class-D amplifier
  • TAS6424-Q1 - Four-channel digital input Class-D amplifier
  • TAS6584 - Multi-channel amplifier
  • TAS5825M - Stereo high-performance closed-loop Class-D amplifier

Building

Prerequisites

  • Linux kernel headers matching your running kernel
  • GCC compiler
  • Make

Build as Kernel Module

cd tasdevice
make -C /lib/modules/$(uname -r)/build M=$(pwd) CONFIG_SND_SOC_TASDEVICE=m modules

The compiled module will be snd-soc-tasdevice.ko.

Cross-compilation (BeagleBone Black)

See compile-scripts/BBB-compile-tool/ for BeagleBone Black cross-compilation scripts.

Installation

# Copy module to kernel modules directory
sudo cp snd-soc-tasdevice.ko /lib/modules/$(uname -r)/extra/

# Update module dependencies
sudo depmod -a

# Load the module
sudo modprobe snd-soc-tasdevice

Device Tree Configuration

Example device tree entry:

i2c {
    tasdevice: tasdevice@6a {
        compatible = "ti,tas6424";
        reg = <0x6a>, <0x6b>;  /* primary and secondary devices */
        #sound-dai-cells = <0>;
        reset-gpios = <&gpio1 10 GPIO_ACTIVE_HIGH>;
        interrupt-parent = <&gpio1>;
        interrupts = <15>;
    };
};

See ti,tasdevice.yaml for complete device tree binding documentation.

Development

Pre-commit Hooks

This repository includes a git pre-commit hook that performs linting checks:

  • Kernel coding style checks using checkpatch.pl
  • Basic syntax validation
  • Trailing whitespace detection
  • Line ending checks

Setup

Run the setup script to install the git hooks:

./scripts/setup-git-hooks.sh

This will install the pre-commit hook to .git/hooks/pre-commit.

Usage

The hook runs automatically on git commit. It will check all staged .c and .h files.

To bypass the hook (not recommended):

git commit --no-verify

Manual Testing

You can test the hook manually:

.git/hooks/pre-commit

Code Style

This driver follows the Linux kernel coding style. Key points:

  • Use tabs (not spaces) for indentation
  • Line length: 80 characters preferred, 100 maximum
  • Function documentation in kernel-doc format
  • Follow kernel naming conventions

Firmware Files

Firmware binary files should be placed in /lib/firmware/ with the naming pattern:

  • tas5805-{N}amp-reg.bin (where N is the number of devices)
  • tas5822-{N}amp-reg.bin
  • tas6424-{N}amp-reg.bin

Example: tas5805-2amp-reg.bin for a 2-device TAS5805 configuration.

Debugging

The driver provides several sysfs interfaces for debugging:

  • /sys/bus/i2c/devices/*/reg - Read/write registers
  • /sys/bus/i2c/devices/*/regdump - Dump register page
  • /sys/bus/i2c/devices/*/regbininfo_list - List firmware configurations
  • /sys/bus/i2c/devices/*/regcfg_list - View configuration details
  • /sys/bus/i2c/devices/*/devinfo - Device information

License

Copyright (C) 2022 - 2023, Texas Instruments Incorporated

See individual source files for license details.

Authors

References

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors