From patchwork Wed Apr 25 09:39:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinod Koul X-Patchwork-Id: 141624 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp627836lji; Wed, 25 Apr 2018 02:36:15 -0700 (PDT) X-Google-Smtp-Source: AIpwx49H4+9WUAUgZlLo6PQrgGtNbc9t0cus1gJxY16UqjcgnnSpWmW8E+LaqX6k7VRbriMqKnxt X-Received: by 10.28.101.6 with SMTP id z6mr13474506wmb.86.1524648975862; Wed, 25 Apr 2018 02:36:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524648975; cv=none; d=google.com; s=arc-20160816; b=jgUuGhjF4LEvyDzFPexQJi1cN4/gwbqNrq5QyMLzQYn63mvo3aPYBJXyxAIIUTr5Cn L7I2HcV19E0Wnu8fZVHz+v/tBTqPnjszj5qaneA3okQuVFIOoE2lZS3tNYNhIUl/LgUF kfHy0iTMZXMJceJH/VohYixHRdopdo9ProcxECoyteVL/MSaBUBAcHHUN2xIwyjwqtdh 6rPDCOL0v7TlDXROQnAlHTOTfO1qBmlkncWKBcgV3EK8X33/mVT1aeXATPBGiM8Vl/DH qswdtYPq7YdIutc/1l3MXafa+YiLNTgkPzzt5IkX7a+c9YwVQs/94jPxru3NeERMGiEk 5RxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:references:in-reply-to:message-id :date:to:from:delivered-to:arc-authentication-results; bh=YJHAwGrTLO5UaIesSspInx0MSY28bnLqlgp1L0gFp+M=; b=J4WLixh8KaR8o7z13wbIagOFs0whUQdggW8li02RHcuI4Ry2rr4HX5HXkhIkv22UNo Ty94L97QzAHGk3/S7ByU/mholUoudTUlCezON+w0/PAXyV/6kT9RpaOoNHGBtD8/qFSb 3S7N0wwU9F/J5GuClyNLB35cVzmudsgLbpFhG0JLpA+gw3zzcDXfcMMnhzgz3+e3lyHy SWNMLpOEl2mpWOJtRhgBPo+CLXKVeyn59twUCqhFVmyznKg/1feDnrG+R065TheumvVm jtCYN8dNyOBhBN8/VPIU0dhsp11/FSmr4xh+UX86ljmyyunWbQTVSUISlz3H5cNZTPQR O0+g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org Return-Path: Received: from alsa0.perex.cz (alsa0.perex.cz. [77.48.224.243]) by mx.google.com with ESMTP id 77si8522679wmx.81.2018.04.25.02.36.15; Wed, 25 Apr 2018 02:36:15 -0700 (PDT) Received-SPF: pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) client-ip=77.48.224.243; Authentication-Results: mx.google.com; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 88D53267791; Wed, 25 Apr 2018 11:35:22 +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 161722677AD; Wed, 25 Apr 2018 11:35:20 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail1.perex.cz X-Spam-Level: X-Spam-Status: No, score=-5.0 required=5.0 tests=RCVD_IN_DNSWL_HI autolearn=disabled version=3.4.0 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by alsa0.perex.cz (Postfix) with ESMTP id 17F97267753 for ; Wed, 25 Apr 2018 11:35:10 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Apr 2018 02:35:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,325,1520924400"; d="scan'208";a="34503913" Received: from vkoul-udesk7.iind.intel.com ([10.223.84.143]) by fmsmga007.fm.intel.com with ESMTP; 25 Apr 2018 02:35:07 -0700 From: Vinod Koul To: Greg KH Date: Wed, 25 Apr 2018 15:09:19 +0530 Message-Id: <1524649163-12088-10-git-send-email-vkoul@kernel.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1524649163-12088-1-git-send-email-vkoul@kernel.org> References: <1524649163-12088-1-git-send-email-vkoul@kernel.org> Cc: ALSA , tiwai@suse.de, Pierre-Louis Bossart , liam.r.girdwood@linux.intel.com, patches.audio@intel.com, Vinod Koul , broonie@kernel.org, Shreyas NC Subject: [alsa-devel] [PATCH v5 09/13] soundwire: Remove cdns_master_ops 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 From: Shreyas NC There can be instances where drivers using Cadence IP might want to set sdw_master_ops differently per instance of it's use, so remove the cdns_master_ops and export the APIs. Signed-off-by: Shreyas NC Signed-off-by: Vinod Koul --- drivers/soundwire/cadence_master.c | 17 ++++++----------- drivers/soundwire/cadence_master.h | 8 ++++++++ drivers/soundwire/intel.c | 11 +++++++++-- 3 files changed, 23 insertions(+), 13 deletions(-) -- 2.7.4 _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel diff --git a/drivers/soundwire/cadence_master.c b/drivers/soundwire/cadence_master.c index 3a9b1462039b..b0c09efd8f83 100644 --- a/drivers/soundwire/cadence_master.c +++ b/drivers/soundwire/cadence_master.c @@ -396,7 +396,7 @@ static int cdns_prep_msg(struct sdw_cdns *cdns, struct sdw_msg *msg, int *cmd) return 0; } -static enum sdw_command_response +enum sdw_command_response cdns_xfer_msg(struct sdw_bus *bus, struct sdw_msg *msg) { struct sdw_cdns *cdns = bus_to_cdns(bus); @@ -422,8 +422,9 @@ cdns_xfer_msg(struct sdw_bus *bus, struct sdw_msg *msg) exit: return ret; } +EXPORT_SYMBOL(cdns_xfer_msg); -static enum sdw_command_response +enum sdw_command_response cdns_xfer_msg_defer(struct sdw_bus *bus, struct sdw_msg *msg, struct sdw_defer *defer) { @@ -443,8 +444,9 @@ cdns_xfer_msg_defer(struct sdw_bus *bus, return _cdns_xfer_msg(cdns, msg, cmd, 0, msg->len, true); } +EXPORT_SYMBOL(cdns_xfer_msg_defer); -static enum sdw_command_response +enum sdw_command_response cdns_reset_page_addr(struct sdw_bus *bus, unsigned int dev_num) { struct sdw_cdns *cdns = bus_to_cdns(bus); @@ -456,6 +458,7 @@ cdns_reset_page_addr(struct sdw_bus *bus, unsigned int dev_num) return cdns_program_scp_addr(cdns, &msg); } +EXPORT_SYMBOL(cdns_reset_page_addr); /* * IRQ handling @@ -727,14 +730,6 @@ int sdw_cdns_init(struct sdw_cdns *cdns) } EXPORT_SYMBOL(sdw_cdns_init); -struct sdw_master_ops sdw_cdns_master_ops = { - .read_prop = sdw_master_read_prop, - .xfer_msg = cdns_xfer_msg, - .xfer_msg_defer = cdns_xfer_msg_defer, - .reset_page_addr = cdns_reset_page_addr, -}; -EXPORT_SYMBOL(sdw_cdns_master_ops); - /** * sdw_cdns_probe() - Cadence probe routine * @cdns: Cadence instance diff --git a/drivers/soundwire/cadence_master.h b/drivers/soundwire/cadence_master.h index beaf6c9804eb..3ec74fa5f4f9 100644 --- a/drivers/soundwire/cadence_master.h +++ b/drivers/soundwire/cadence_master.h @@ -44,5 +44,13 @@ irqreturn_t sdw_cdns_thread(int irq, void *dev_id); int sdw_cdns_init(struct sdw_cdns *cdns); int sdw_cdns_enable_interrupt(struct sdw_cdns *cdns); +enum sdw_command_response +cdns_xfer_msg(struct sdw_bus *bus, struct sdw_msg *msg); +enum sdw_command_response +cdns_xfer_msg_defer(struct sdw_bus *bus, + struct sdw_msg *msg, struct sdw_defer *defer); + +enum sdw_command_response +cdns_reset_page_addr(struct sdw_bus *bus, unsigned int dev_num); #endif /* __SDW_CADENCE_H */ diff --git a/drivers/soundwire/intel.c b/drivers/soundwire/intel.c index 86a7bd1fc912..aa0c60133de5 100644 --- a/drivers/soundwire/intel.c +++ b/drivers/soundwire/intel.c @@ -252,6 +252,13 @@ static int intel_prop_read(struct sdw_bus *bus) return 0; } +static struct sdw_master_ops sdw_intel_ops = { + .read_prop = sdw_master_read_prop, + .xfer_msg = cdns_xfer_msg, + .xfer_msg_defer = cdns_xfer_msg_defer, + .reset_page_addr = cdns_reset_page_addr, +}; + /* * probe and init */ @@ -276,8 +283,8 @@ static int intel_probe(struct platform_device *pdev) sdw_cdns_probe(&sdw->cdns); /* Set property read ops */ - sdw_cdns_master_ops.read_prop = intel_prop_read; - sdw->cdns.bus.ops = &sdw_cdns_master_ops; + sdw_intel_ops.read_prop = intel_prop_read; + sdw->cdns.bus.ops = &sdw_intel_ops; platform_set_drvdata(pdev, sdw);