From patchwork Mon Aug 7 12:22:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleksandr Andrushchenko X-Patchwork-Id: 9885227 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 128DF60363 for ; Mon, 7 Aug 2017 12:24:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 029D028618 for ; Mon, 7 Aug 2017 12:24:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EB67C28670; Mon, 7 Aug 2017 12:24:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=no version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1A3F228618 for ; Mon, 7 Aug 2017 12:24:25 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 53EE4267267; Mon, 7 Aug 2017 14:23:19 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 30906267255; Mon, 7 Aug 2017 14:23:16 +0200 (CEST) Received: from mail-lf0-f67.google.com (mail-lf0-f67.google.com [209.85.215.67]) by alsa0.perex.cz (Postfix) with ESMTP id 744B126720D for ; Mon, 7 Aug 2017 14:23:05 +0200 (CEST) Received: by mail-lf0-f67.google.com with SMTP id x16so211392lfb.4 for ; Mon, 07 Aug 2017 05:23:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ebt4vcvGPZuotTDtfKiFUJgBv4RS1Pb8Q1I7SjabkqI=; b=hIQzjimts866Zfg9p2mYu5/zgWX3kveFrznhK58R/7gnLNCD39glolqkcJRTDcjqrW yBs6FmsnxLC3WFwF/T1RrifVsWZ8uIm7EUc+eOT8QQk2eKYtiIeJXadAFqB98fA4V4o/ VW7O5ffmU4FfhZ1nkiE5PmgkorNp83wYd0VlI2aeGCdzj+RC8n7YFS+ImeVORDikWHSD DJGXeGCBWnrvKaksPUnLtHQNkKIsZIqnuvJD9pSNUJbEn7lZlLFkZKctIeOaXOP0FC8v CoA50JkC6L7sMGBoEWT3/v+3BK+L+KsicrTETR4Gmz+ad3OqMASzQzsZT66K8nFfn9CN RIYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ebt4vcvGPZuotTDtfKiFUJgBv4RS1Pb8Q1I7SjabkqI=; b=m+KspT0BX58WllQ3b5jwha6k4PL64g2CS+cqpq2/OnEpswEzDBmeHV6Ce9DcL2lqwq QEApDQgEAvuVz/cfs9lkvCWibb5+4gtbhsvVuBKDeyyWwUtEItJaao11zw5LLtEJoCym ryvw3K8vpN5u081ldUB78DJmDDF8PPLdaXGG1dOTUmm8WYdj+j3sK5uAvU+To1uMnSzK os60X0VCxUkrJgb6lG11syEIToKsr6MUw7iXJNDS+tpLUolTb+gvBgagd7tqGzsCrVup pkm89eJLueIEtYhB4IkkkVFdGDFJq/IaKRbqzv8oJXL5oBOYqHREgyfQ0ZtEJQMwNEy0 DzBg== X-Gm-Message-State: AHYfb5iV5WKFCXesMw9+9SBBh5X8qW1PRVel/04OTsYRuTR0xhdLzX85 cDY1mBaCTYx5kfDo X-Received: by 10.25.21.204 with SMTP id 73mr90821lfv.241.1502108584510; Mon, 07 Aug 2017 05:23:04 -0700 (PDT) Received: from a2k-HP-ProDesk-600-G2-SFF.kyiv.epam.com (ll-53.209.223.85.sovam.net.ua. [85.223.209.53]) by smtp.gmail.com with ESMTPSA id m143sm1031821lfm.77.2017.08.07.05.23.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 07 Aug 2017 05:23:04 -0700 (PDT) From: Oleksandr Andrushchenko To: alsa-devel@alsa-project.org, xen-devel@lists.xen.org, linux-kernel@vger.kernel.org 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> Cc: andr2000@gmail.com, Oleksandr Andrushchenko , tiwai@suse.com Subject: [alsa-devel] [PATCH RESEND1 01/12] ALSA: vsnd: Introduce Xen para-virtualized sound frontend driver X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP 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}}");