/* * media_device_open.c - Media Controller Device Open Test * * Copyright (c) 2016 Shuah Khan * Copyright (c) 2016 Samsung Electronics Co., Ltd. * * This file is released under the GPLv2. */ /* * This file adds a test for Media Controller API. * This test should be run as root and should not be * included in the Kselftest run. This test should be * run when hardware and driver that makes use Media * Controller API are present in the system. * * This test opens user specified Media Device and calls * MEDIA_IOC_DEVICE_INFO ioctl, closes the file, and exits. * * Usage: * sudo ./media_device_open -d /dev/mediaX * * Run this test is a loop and run bind/unbind on the driver. */ #include #include #include #include #include #include #include #include #include int main(int argc, char **argv) { int opt; char media_device[256]; int count = 0; struct media_device_info mdi; int ret; int fd; if (argc < 2) { printf("Usage: %s [-d ]\n", argv[0]); exit(-1); } /* Process arguments */ while ((opt = getopt(argc, argv, "d:")) != -1) { switch (opt) { case 'd': strncpy(media_device, optarg, sizeof(media_device) - 1); media_device[sizeof(media_device)-1] = '\0'; break; default: printf("Usage: %s [-d ]\n", argv[0]); exit(-1); } } if (getuid() != 0) { printf("Please run the test as root - Exiting.\n"); exit(-1); } /* Open Media device and keep it open */ fd = open(media_device, O_RDWR); if (fd == -1) { printf("Media Device open errno %s\n", strerror(errno)); exit(-1); } ret = ioctl(fd, MEDIA_IOC_DEVICE_INFO, &mdi); if (ret < 0) printf("Media Device Info errno %s\n", strerror(errno)); else printf("Media device model %s driver %s\n", mdi.model, mdi.driver); } id=3c223c19aea85d3dda1416c187915f4a30b04b1f'>commitdiff
diff options
context:
space:
mode:
authorMarkus Mayer <mmayer@broadcom.com>2016-12-19 12:10:28 -0800
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2017-01-27 11:43:49 +0100
commit3c223c19aea85d3dda1416c187915f4a30b04b1f (patch)
tree2d2021f8161db3e9ed38b9a966a225b66dff8e58 /sound/soc/ux500
parent9b02c54bc951fca884ba5719f42a27e8240965bf (diff)
cpufreq: brcmstb-avs-cpufreq: properly retrieve P-state upon suspend
The AVS GET_PMAP command does return a P-state along with the P-map information. However, that P-state is the initial P-state when the P-map was first downloaded to AVS. It is *not* the current P-state. Therefore, we explicitly retrieve the P-state using the GET_PSTATE command. Signed-off-by: Markus Mayer <mmayer@broadcom.com> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'sound/soc/ux500')