#include #include #include #include #include #include #include "header.h" #include "util.h" #define mfspr(rn) ({unsigned long rval; \ asm volatile("mfspr %0," __stringify(rn) \ : "=r" (rval)); rval; }) #define SPRN_PVR 0x11F /* Processor Version Register */ #define PVR_VER(pvr) (((pvr) >> 16) & 0xFFFF) /* Version field */ #define PVR_REV(pvr) (((pvr) >> 0) & 0xFFFF) /* Revison field */ int get_cpuid(char *buffer, size_t sz) { unsigned long pvr; int nb; pvr = mfspr(SPRN_PVR); nb = scnprintf(buffer, sz, "%lu,%lu$", PVR_VER(pvr), PVR_REV(pvr)); /* look for end marker to ensure the entire data fit */ if (strchr(buffer, '$')) { buffer[nb-1] = '\0'; return 0; } return -1; } char * get_cpuid_str(void) { char *bufp; if (asprintf(&bufp, "%.8lx", mfspr(SPRN_PVR)) < 0) bufp = NULL; return bufp; } 830db1bdb254e4b50d366010b219286b8c937'/> net-next plumbingsTobias Klauser
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel J.E. Mol <marcel@mesa.nl>2017-01-30 19:26:40 +0100
committerJohan Hovold <johan@kernel.org>2017-01-31 17:27:04 +0100
commitd07830db1bdb254e4b50d366010b219286b8c937 (patch)
tree354d7fca237fa3d7e7e63c2196eaa4e1086838ea /sound/core/oss/mulaw.c
parent5d03a2fd2292e71936c4235885c35ccc3c94695b (diff)
USB: serial: pl2303: add ATEN device ID
Seems that ATEN serial-to-usb devices using pl2303 exist with different device ids. This patch adds a missing device ID so it is recognised by the driver. Signed-off-by: Marcel J.E. Mol <marcel@mesa.nl> Cc: stable <stable@vger.kernel.org> Signed-off-by: Johan Hovold <johan@kernel.org>
Diffstat (limited to 'sound/core/oss/mulaw.c')