Merge branch 'develop' into kirkstone
This commit is contained in:
commit
5c401fa0aa
|
|
@ -0,0 +1 @@
|
||||||
|
am335x-nmhw24
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
chip "da9063-hwmon-*"
|
||||||
|
label in3 "wwan0-supply"
|
||||||
|
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
|
||||||
|
|
||||||
|
PACKAGECONFIG = ""
|
||||||
|
|
||||||
|
|
@ -0,0 +1,138 @@
|
||||||
|
From 0992bce0612852dd10006a8e182b4e69361c99dc Mon Sep 17 00:00:00 2001
|
||||||
|
From: Alexandre Bard <alexandre.bard@netmodule.com>
|
||||||
|
Date: Fri, 12 Aug 2022 14:32:09 +0200
|
||||||
|
Subject: [PATCH] libsensors: Fix support for driver names with dashes
|
||||||
|
|
||||||
|
The dash is used as delimiter in the conversion rules. This works fine
|
||||||
|
with kernel drivers with simple names like lm75, but some drivers have a
|
||||||
|
compound name like da9063-hwmon which were not handled properly by these
|
||||||
|
rules.
|
||||||
|
|
||||||
|
Signed-off-by: Alexandre Bard <alexandre.bard@netmodule.com>
|
||||||
|
---
|
||||||
|
lib/data.c | 102 +++++++++++++++++++++++++++++++++--------------------
|
||||||
|
1 file changed, 64 insertions(+), 38 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/lib/data.c b/lib/data.c
|
||||||
|
index c5aea429..318a35f8 100644
|
||||||
|
--- a/lib/data.c
|
||||||
|
+++ b/lib/data.c
|
||||||
|
@@ -83,54 +83,80 @@ void sensors_free_chip_name(sensors_chip_name *chip)
|
||||||
|
int sensors_parse_chip_name(const char *name, sensors_chip_name *res)
|
||||||
|
{
|
||||||
|
char *dash;
|
||||||
|
+ const char * prefix = name;
|
||||||
|
+ const char * bus_type;
|
||||||
|
|
||||||
|
/* First, the prefix. It's either "*" or a real chip name. */
|
||||||
|
- if (!strncmp(name, "*-", 2)) {
|
||||||
|
- res->prefix = SENSORS_CHIP_NAME_PREFIX_ANY;
|
||||||
|
- name += 2;
|
||||||
|
+ if (!strncmp(prefix, "*-", 2)) {
|
||||||
|
+ bus_type = prefix + 2;
|
||||||
|
} else {
|
||||||
|
- if (!(dash = strchr(name, '-')))
|
||||||
|
+ if (!(dash = strchr(prefix, '-')))
|
||||||
|
return -SENSORS_ERR_CHIP_NAME;
|
||||||
|
- res->prefix = strndup(name, dash - name);
|
||||||
|
- if (!res->prefix)
|
||||||
|
- sensors_fatal_error(__func__,
|
||||||
|
- "Allocating name prefix");
|
||||||
|
- name = dash + 1;
|
||||||
|
+ bus_type = dash + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
- /* Then we have either a sole "*" (all chips with this name) or a bus
|
||||||
|
- type and an address. */
|
||||||
|
- if (!strcmp(name, "*")) {
|
||||||
|
- res->bus.type = SENSORS_BUS_TYPE_ANY;
|
||||||
|
- res->bus.nr = SENSORS_BUS_NR_ANY;
|
||||||
|
- res->addr = SENSORS_CHIP_NAME_ADDR_ANY;
|
||||||
|
- return 0;
|
||||||
|
+ /* We go through the name until we find a valid bus type or "*"
|
||||||
|
+ (all chips with this name). Dashes on the way are considered
|
||||||
|
+ part of the prefix. */
|
||||||
|
+ while (1) {
|
||||||
|
+ if (!strcmp(bus_type, "*")) {
|
||||||
|
+ res->bus.type = SENSORS_BUS_TYPE_ANY;
|
||||||
|
+ break;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ if (!(dash = strchr(bus_type, '-')))
|
||||||
|
+ return -SENSORS_ERR_CHIP_NAME;
|
||||||
|
+
|
||||||
|
+ if (!strncmp(bus_type, "i2c", dash - bus_type)) {
|
||||||
|
+ res->bus.type = SENSORS_BUS_TYPE_I2C;
|
||||||
|
+ break;
|
||||||
|
+ }
|
||||||
|
+ else if (!strncmp(bus_type, "isa", dash - bus_type)) {
|
||||||
|
+ res->bus.type = SENSORS_BUS_TYPE_ISA;
|
||||||
|
+ break;
|
||||||
|
+ }
|
||||||
|
+ else if (!strncmp(bus_type, "pci", dash - bus_type)) {
|
||||||
|
+ res->bus.type = SENSORS_BUS_TYPE_PCI;
|
||||||
|
+ break;
|
||||||
|
+ }
|
||||||
|
+ else if (!strncmp(bus_type, "spi", dash - bus_type)) {
|
||||||
|
+ res->bus.type = SENSORS_BUS_TYPE_SPI;
|
||||||
|
+ break;
|
||||||
|
+ }
|
||||||
|
+ else if (!strncmp(bus_type, "virtual", dash - bus_type)) {
|
||||||
|
+ res->bus.type = SENSORS_BUS_TYPE_VIRTUAL;
|
||||||
|
+ break;
|
||||||
|
+ }
|
||||||
|
+ else if (!strncmp(bus_type, "acpi", dash - bus_type)) {
|
||||||
|
+ res->bus.type = SENSORS_BUS_TYPE_ACPI;
|
||||||
|
+ break;
|
||||||
|
+ }
|
||||||
|
+ else if (!strncmp(bus_type, "hid", dash - bus_type)) {
|
||||||
|
+ res->bus.type = SENSORS_BUS_TYPE_HID;
|
||||||
|
+ break;
|
||||||
|
+ }
|
||||||
|
+ else if (!strncmp(bus_type, "mdio", dash - bus_type)) {
|
||||||
|
+ res->bus.type = SENSORS_BUS_TYPE_MDIO;
|
||||||
|
+ break;
|
||||||
|
+ }
|
||||||
|
+ else if (!strncmp(bus_type, "scsi", dash - bus_type)) {
|
||||||
|
+ res->bus.type = SENSORS_BUS_TYPE_SCSI;
|
||||||
|
+ break;
|
||||||
|
+ }
|
||||||
|
+ else {
|
||||||
|
+ /* Assume the prefix contains a dash */
|
||||||
|
+ bus_type = dash + 1;
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
|
||||||
|
- if (!(dash = strchr(name, '-')))
|
||||||
|
- goto ERROR;
|
||||||
|
- if (!strncmp(name, "i2c", dash - name))
|
||||||
|
- res->bus.type = SENSORS_BUS_TYPE_I2C;
|
||||||
|
- else if (!strncmp(name, "isa", dash - name))
|
||||||
|
- res->bus.type = SENSORS_BUS_TYPE_ISA;
|
||||||
|
- else if (!strncmp(name, "pci", dash - name))
|
||||||
|
- res->bus.type = SENSORS_BUS_TYPE_PCI;
|
||||||
|
- else if (!strncmp(name, "spi", dash - name))
|
||||||
|
- res->bus.type = SENSORS_BUS_TYPE_SPI;
|
||||||
|
- else if (!strncmp(name, "virtual", dash - name))
|
||||||
|
- res->bus.type = SENSORS_BUS_TYPE_VIRTUAL;
|
||||||
|
- else if (!strncmp(name, "acpi", dash - name))
|
||||||
|
- res->bus.type = SENSORS_BUS_TYPE_ACPI;
|
||||||
|
- else if (!strncmp(name, "hid", dash - name))
|
||||||
|
- res->bus.type = SENSORS_BUS_TYPE_HID;
|
||||||
|
- else if (!strncmp(name, "mdio", dash - name))
|
||||||
|
- res->bus.type = SENSORS_BUS_TYPE_MDIO;
|
||||||
|
- else if (!strncmp(name, "scsi", dash - name))
|
||||||
|
- res->bus.type = SENSORS_BUS_TYPE_SCSI;
|
||||||
|
- else
|
||||||
|
- goto ERROR;
|
||||||
|
name = dash + 1;
|
||||||
|
|
||||||
|
+ /* We can now properly set the prefix */
|
||||||
|
+ res->prefix = strndup(prefix, bus_type - prefix - 1);
|
||||||
|
+ if (!res->prefix)
|
||||||
|
+ sensors_fatal_error(__func__,
|
||||||
|
+ "Allocating name prefix");
|
||||||
|
+
|
||||||
|
/* Some bus types (i2c, spi) have an additional bus number.
|
||||||
|
For these, the next part is either a "*" (any bus of that type)
|
||||||
|
or a decimal number. */
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
|
||||||
|
|
||||||
|
SRC_URI += "file://0001-libsensors-Fix-support-for-driver-names-with-dashes.patch"
|
||||||
|
|
||||||
|
PACKAGECONFIG = ""
|
||||||
|
|
||||||
|
|
@ -0,0 +1,34 @@
|
||||||
|
LICENSE = "CLOSED"
|
||||||
|
LIC_FILES_CHKSUM = ""
|
||||||
|
|
||||||
|
SRC_URI = "git://gitea@git.netmodule.intranet/NRSW/lpa.git;branch=sdk_1.6;protocol=ssh \
|
||||||
|
"
|
||||||
|
|
||||||
|
PV = "1.0+git${SRCPV}"
|
||||||
|
SRCREV = "454007f13a713943ae1caff6704d889fde06c1c2"
|
||||||
|
|
||||||
|
S = "${WORKDIR}/git"
|
||||||
|
|
||||||
|
DEPENDS = "curl openssl"
|
||||||
|
|
||||||
|
EXTRA_OEMAKE_append = "-j 1 SEMEDIA_TYPE=toby"
|
||||||
|
|
||||||
|
TARGET_CC_ARCH += "${LDFLAGS}"
|
||||||
|
|
||||||
|
inherit autotools-brokensep
|
||||||
|
|
||||||
|
do_install () {
|
||||||
|
install -d ${D}${libdir}
|
||||||
|
install -d ${D}${datadir}/lpa
|
||||||
|
install -m 755 ${B}/sdk/liblpa.so.1.0.0 ${D}${libdir}
|
||||||
|
ln -sf liblpa.so.1.0.0 ${D}${libdir}/liblpa.so.1
|
||||||
|
ln -sf liblpa.so.1.0.0 ${D}${libdir}/liblpa.so
|
||||||
|
install -d ${D}${bindir}
|
||||||
|
install -m 755 ${B}/lpa/lpa ${D}${bindir}/
|
||||||
|
install -m 644 ${B}/certs/CI-cert_NIST.crt ${D}${datadir}/lpa/
|
||||||
|
install -m 644 ${B}/certs/GSMA_CE_TEST_CI.crt ${D}${datadir}/lpa/
|
||||||
|
install -m 644 ${B}/certs/GSMA_CE_LIVE_CI.crt ${D}${datadir}/lpa/
|
||||||
|
ln -sf GSMA_CE_LIVE_CI.crt ${D}${datadir}/lpa/default.crt
|
||||||
|
}
|
||||||
|
|
||||||
|
FILES_${PN} += "${bindir}/* ${libdir}/*.so*"
|
||||||
|
|
@ -7,10 +7,12 @@ RDEPENDS:${PN} += " \
|
||||||
libgpiod-python \
|
libgpiod-python \
|
||||||
python3-setuptools \
|
python3-setuptools \
|
||||||
python3-systemd \
|
python3-systemd \
|
||||||
|
lmsensors-sensors \
|
||||||
|
lmsensors-config-libsensors \
|
||||||
"
|
"
|
||||||
DEPENDS = "python3-setuptools-git-version-native"
|
DEPENDS = "python3-setuptools-git-version-native"
|
||||||
|
|
||||||
inherit gitpkgv systemd
|
inherit gitpkgv systemd allarch
|
||||||
|
|
||||||
|
|
||||||
# Package Version (built from tags)
|
# Package Version (built from tags)
|
||||||
|
|
@ -29,11 +31,6 @@ S = "${WORKDIR}/git"
|
||||||
|
|
||||||
inherit setuptools3
|
inherit setuptools3
|
||||||
|
|
||||||
PACKAGE_ARCH = "${MACHINE_ARCH}"
|
|
||||||
do_configure:prepend() {
|
|
||||||
cp ${S}/platforms/${MACHINE}/* ${S}/wwan_config
|
|
||||||
}
|
|
||||||
|
|
||||||
do_install:append() {
|
do_install:append() {
|
||||||
install -d ${D}/${systemd_unitdir}/system/
|
install -d ${D}/${systemd_unitdir}/system/
|
||||||
install -m 0644 ${WORKDIR}/wwan-config@.service ${D}/${systemd_unitdir}/system/
|
install -m 0644 ${WORKDIR}/wwan-config@.service ${D}/${systemd_unitdir}/system/
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,6 @@ SRC_URI = "\
|
||||||
"
|
"
|
||||||
|
|
||||||
S = "${WORKDIR}/git"
|
S = "${WORKDIR}/git"
|
||||||
SSC_KBUILD_EXTRA_SYMBOLS = "${STAGING_INCDIR}/ssc-broker-driver/Module.symvers"
|
|
||||||
|
|
||||||
python __anonymous () {
|
python __anonymous () {
|
||||||
depends = d.getVar('DEPENDS')
|
depends = d.getVar('DEPENDS')
|
||||||
|
|
@ -33,6 +32,6 @@ python __anonymous () {
|
||||||
for dep in depends.split():
|
for dep in depends.split():
|
||||||
if dep.startswith("kernel-module-"):
|
if dep.startswith("kernel-module-"):
|
||||||
extra_symbols.append("${STAGING_INCDIR}/" + dep + "/Module.symvers")
|
extra_symbols.append("${STAGING_INCDIR}/" + dep + "/Module.symvers")
|
||||||
extra_symbols.append(d.getVar("SSC_KBUILD_EXTRA_SYMBOLS"))
|
extra_symbols.append("${STAGING_INCDIR}/ssc-broker-driver/Module.symvers")
|
||||||
d.setVar('KBUILD_EXTRA_SYMBOLS', " ".join(extra_symbols))
|
d.setVar('KBUILD_EXTRA_SYMBOLS', " ".join(extra_symbols))
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue