summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorJinhyung Choi <jinhyung2.choi@samsung.com>2014-03-20 11:13:18 +0900
committerJinhyung Choi <jinhyung2.choi@samsung.com>2014-03-20 11:13:18 +0900
commitfbc91bd211dd42ea830ff6fed9498cec4bdf1dac (patch)
treea6eb18584fca8050d687e0572c78a86444be7943 /hw
parent7b97a3be2fe3e87b12ee1386a11181a7db9f0d5b (diff)
downloadqemu-fbc91bd211dd42ea830ff6fed9498cec4bdf1dac.tar.gz
qemu-fbc91bd211dd42ea830ff6fed9498cec4bdf1dac.tar.bz2
qemu-fbc91bd211dd42ea830ff6fed9498cec4bdf1dac.zip
Device ARGS: added device properties option for sensors & jacks
Sensor devices contains accel, geo, gyro, light and proxi sensors. By device properties, sensor device turn on sensors selectively. The option is now changed to "-device virtio-sensor-pci,sensors=accel&geo&gyro&light&proxi" Jack device is very similar to sensor device. It contains earjack, earkey, charger, usb and hdmi. Jack device's option is "-device virtio-jack-pci,jacks=earjack&usb&charger" Change-Id: If67ce1adf64a22225fe6f28e1ddb16d558e87c7a Signed-off-by: Jinhyung Choi <jinhyung2.choi@samsung.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/virtio/virtio-pci.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
index 5920cd0112..eec210426d 100644
--- a/hw/virtio/virtio-pci.c
+++ b/hw/virtio/virtio-pci.c
@@ -1769,8 +1769,15 @@ static int virtio_sensor_pci_init(VirtIOPCIProxy *vpci_dev)
return 0;
}
+static Property virtio_sensor_pci_properties[] = {
+ DEFINE_PROP_STRING(ATTRIBUTE_NAME_SENSORS, VirtIOSENSORPCI, vdev.sensors),
+ DEFINE_VIRTIO_COMMON_FEATURES(VirtIOPCIProxy, host_features),
+ DEFINE_PROP_END_OF_LIST(),
+};
+
static void virtio_sensor_pci_class_init(ObjectClass *klass, void *data)
{
+ DeviceClass *dc = DEVICE_CLASS(klass);
VirtioPCIClass *k = VIRTIO_PCI_CLASS(klass);
PCIDeviceClass *pcidev_k = PCI_DEVICE_CLASS(klass);
@@ -1779,6 +1786,7 @@ static void virtio_sensor_pci_class_init(ObjectClass *klass, void *data)
pcidev_k->device_id = PCI_DEVICE_ID_VIRTIO_SENSOR;
pcidev_k->revision = VIRTIO_PCI_ABI_VERSION;
pcidev_k->class_id = PCI_CLASS_OTHERS;
+ dc->props = virtio_sensor_pci_properties;
}
static void virtio_sensor_pci_instance_init(Object *obj)
@@ -1851,8 +1859,15 @@ static int virtio_jack_pci_init(VirtIOPCIProxy *vpci_dev)
return 0;
}
+static Property virtio_jack_pci_properties[] = {
+ DEFINE_PROP_STRING(ATTRIBUTE_NAME_JACKS, VirtIOJACKPCI, vdev.jacks),
+ DEFINE_VIRTIO_COMMON_FEATURES(VirtIOPCIProxy, host_features),
+ DEFINE_PROP_END_OF_LIST(),
+};
+
static void virtio_jack_pci_class_init(ObjectClass *klass, void *data)
{
+ DeviceClass *dc = DEVICE_CLASS(klass);
VirtioPCIClass *k = VIRTIO_PCI_CLASS(klass);
PCIDeviceClass *pcidev_k = PCI_DEVICE_CLASS(klass);
@@ -1861,6 +1876,7 @@ static void virtio_jack_pci_class_init(ObjectClass *klass, void *data)
pcidev_k->device_id = PCI_DEVICE_ID_VIRTIO_JACK;
pcidev_k->revision = VIRTIO_PCI_ABI_VERSION;
pcidev_k->class_id = PCI_CLASS_OTHERS;
+ dc->props = virtio_jack_pci_properties;
}
static void virtio_jack_pci_instance_init(Object *obj)