hexdump0815 / imagebuilder

velvet os - simple script framework to build ubuntu 22.04 lts jammy (in older versions also 20.04 lts focal) and debian 12 bookworm (in older versions also 11 bullseye) bootable usb / sd card images for some arm and intel devices - lots of prebuilt images as well
GNU General Public License v3.0
299 stars 44 forks source link

chromebook_x86_uefi: misc: Sound approach 2. Should work with all boards #94

Open EMLommers opened 1 year ago

EMLommers commented 1 year ago

New appoach1, to get audio working without / with SOF / get DA7219 working: (flat) device tree

  1. Extract Device-tree from kernel firmware or kernel ChromeOS, and or overlays. (dts,Dtb,dtbo)
  2. Extract ACPI from chromeOS
    3 build new kernel with (flat) Device-tree
    4 make sure regulator reg_audio: is included.
    5 build kernel with dtb and if needed dtbo overlay

New appoach2, to get audio working without / with SOF / get DA7219 working:

  1. Add to include/sound/da7219.h : u32 vddio; u32 vdd; u32 vddmic;

2 add to acpi dlg,vddio and value 1800 , dlg,vdd value 1800 and dlg,vddmic 3300 3 da719.c read ACPI and write to according u32.

+ if (device_property_read_u32(dev, "dlg,vdd", &of_val32) >= 0) + pdata->vdd = of_val32; +

+ if (device_property_read_u32(dev, "dlg,vddio", &of_val32) >= 0) + pdata->vddio = of_val32; +

+ if (device_property_read_u32(dev, "dlg,vddmic", &of_val32) >= 0) + pdata->vddmic = of_val32; + ret = regulator_get_voltage(vddio); + / If regulator_get_voltage() fails, try to use vddio from pdata. / + if (ret < 0 && da7219->pdata) + ret = da7219->pdata->vddio;

+ ret = regulator_get_voltage(vdd); + / If regulator_get_voltage() fails, try to use vdd from pdata. / + if (ret < 0 && da7219->pdata) + ret = da7219->pdata->vdd;

+ret = regulator_get_voltage(vddmic); / If regulator_get_voltage() fails, try to use vddio from pdata. / + if (ret < 0 && da7219->pdata) + ret = da7219->pdata->vddmic;

+ dev_warn(component->dev, "Invalid VDDIO voltage: %d mV\n", + ret);

+ / Handle DT/ACPI/Platform data / + da7219->pdata = dev_get_platdata(component->dev); + if (!da7219->pdata) + da7219->pdata = da7219_fw_to_pdata(component); \ +

Or use Device tree and ACPI together.. Works guaranteed!! Thanks

hexdump0815 commented 1 year ago

@EMLommers - i'm not fully understanding what you mean: are you speaking about adding dtb info also on intel systems to the kernel? what is the problem, which is solved this way? i got glk audio qorking quite well at least with uefi payload - is your approach intended for the non-uefi case?