From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752403AbdHGM1Z (ORCPT ); Mon, 7 Aug 2017 08:27:25 -0400 Received: from mail-lf0-f66.google.com ([209.85.215.66]:35091 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753158AbdHGMXF (ORCPT ); Mon, 7 Aug 2017 08:23:05 -0400 From: Oleksandr Andrushchenko To: alsa-devel@alsa-project.org, xen-devel@lists.xen.org, linux-kernel@vger.kernel.org Cc: perex@perex.cz, tiwai@suse.com, andr2000@gmail.com, Oleksandr Andrushchenko Subject: [PATCH RESEND1 01/12] ALSA: vsnd: Introduce Xen para-virtualized sound frontend driver Date: Mon, 7 Aug 2017 15:22:46 +0300 Message-Id: <1502108577-8099-2-git-send-email-andr2000@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1502108577-8099-1-git-send-email-andr2000@gmail.com> References: <1502108577-8099-1-git-send-email-andr2000@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Oleksandr Andrushchenko Introduce skeleton of the para-virtualized Xen sound frontend driver. This patch only adds required essential stubs. Signed-off-by: Oleksandr Andrushchenko --- sound/drivers/xen-front.c | 78 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 sound/drivers/xen-front.c diff --git a/sound/drivers/xen-front.c b/sound/drivers/xen-front.c new file mode 100644 index 000000000000..61779c36cae3 --- /dev/null +++ b/sound/drivers/xen-front.c @@ -0,0 +1,78 @@ +/* + * Xen para-virtual sound device + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * Based on: sound/drivers/dummy.c + * + * Copyright (C) 2016-2017 EPAM Systems Inc. + * + * Author: Oleksandr Andrushchenko + */ + +#include + +#include +#include +#include + +#include + +static void xdrv_be_on_changed(struct xenbus_device *xb_dev, + enum xenbus_state backend_state) +{ +} + +static int xdrv_probe(struct xenbus_device *xb_dev, + const struct xenbus_device_id *id) +{ + return 0; +} + +static int xdrv_remove(struct xenbus_device *dev) +{ + return 0; +} + +static const struct xenbus_device_id xdrv_ids[] = { + { XENSND_DRIVER_NAME }, + { "" } +}; + +static struct xenbus_driver xen_driver = { + .ids = xdrv_ids, + .probe = xdrv_probe, + .remove = xdrv_remove, + .otherend_changed = xdrv_be_on_changed, +}; + +static int __init xdrv_init(void) +{ + if (!xen_domain()) + return -ENODEV; + + pr_info("Initialising Xen " XENSND_DRIVER_NAME " frontend driver\n"); + return xenbus_register_frontend(&xen_driver); +} + +static void __exit xdrv_cleanup(void) +{ + pr_info("Unregistering Xen " XENSND_DRIVER_NAME " frontend driver\n"); + xenbus_unregister_driver(&xen_driver); +} + +module_init(xdrv_init); +module_exit(xdrv_cleanup); + +MODULE_DESCRIPTION("Xen virtual sound device frontend"); +MODULE_LICENSE("GPL"); +MODULE_ALIAS("xen:"XENSND_DRIVER_NAME); +MODULE_SUPPORTED_DEVICE("{{ALSA,Virtual soundcard}}"); -- 2.7.4