Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp3409817rwb; Fri, 30 Sep 2022 03:14:25 -0700 (PDT) X-Google-Smtp-Source: AMsMyM47JGmGaRklBk5+lFqjBZvse4gAI+p/ZTBaqtgA6VNMma+D4AhKje3b8/P8o8kQ9dCkDkBa X-Received: by 2002:a17:907:3e0f:b0:782:dc11:da99 with SMTP id hp15-20020a1709073e0f00b00782dc11da99mr5716649ejc.499.1664532864724; Fri, 30 Sep 2022 03:14:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664532864; cv=none; d=google.com; s=arc-20160816; b=0k0mxlUySmJ/TVrVImKYYXEkTmXmAE/dHoM92v99NfkmbStSn7Cg8khyqpAG2i9C7H rhgNwEYB2pWYrGzqX7jqW4IZIjjn4SCyogNpxfCzxssIplGF/7V57+heQ5HB24SWzV0g biTQCgPzVT4JmI3AHcuvCZm9VKYwWgE51U84VgRePBxcclncaH5dcX9UZsQLiWuLjuDM cuyggedYNk3w3xftpS2tD810vVVRvh56rbYrel7bc5NZECqbNQV/yPIO6UU1t52wSXgA iOgNBFukcASmMOrZN4Gq8rKyyTneToURKY3GXtsFNbEBuTo/GBJB/PqpXRhmzWgcZ4jS OIQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=cyWY+iWJsM2WZ/8eyhEcWdOOOMLwlMoJ8717QdY8qCM=; b=h3QVtBjLSpLCdTJ7mpazQ1Bs2LJ+nBd2kGmxHy4fBCT3BndfjADH36esdw9ztLsnkA m/4DODNJ+vVJnhXnEmF7F3slS/VShuumcoJ+kWEV6F95wZA9sfIbyAcU3XaLnV2T1zlE w4XkvWPSWSS032qcetgQ7+fsr7nvqydPLdr0UlOIEvbIY8gK9NCGo78JX73ZwgDS4qI7 oE4wncjCFDdrQ4psP6W12pwC5J/1SpSo88TvYon9022rqvZlvSQvW5bkrkKkp9liZyan ZvKon7UNGX7wubDB4VGMn77BK/cQ1vJTEkrTV2s6oLKuJBAzEpwVYNQfyJmsBe+bP9wv +uQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=QIbXcoGu; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hq21-20020a1709073f1500b0077984f39dcfsi1484887ejc.408.2022.09.30.03.13.58; Fri, 30 Sep 2022 03:14:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=QIbXcoGu; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231420AbiI3J7C (ORCPT + 99 others); Fri, 30 Sep 2022 05:59:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41854 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231406AbiI3J65 (ORCPT ); Fri, 30 Sep 2022 05:58:57 -0400 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B1EB187354 for ; Fri, 30 Sep 2022 02:58:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1664531937; x=1696067937; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=weArQEE1+BAZ7Td37iXcT7Dn5h69cCu0jphqGbByJuE=; b=QIbXcoGuP7BNOPMzlsSk+MtAdIzlCVni0SCDUlMhx2ImXyxDObXQvB9s J1yuJQTwPC/S4z/M5/FNgNCinnH5ugB46FX0hrItB7/nPWDbY7tUNrGjh iuwx9w+79/cbhON8yQSmsP1wN5DW6z+D04vn6Jj2fTlOGtKnoorOqnBiM c9moCiuSEPMkWNyQKw5ISbURDc5Nxs6lZvvyRl+aGzCO8e/olc9xeB+v3 KzqFdQ6RtUxRi1DFfdHwhFdogfSJ6X86YSDVZW/nPTxaO+8dOVPauRX9B ajOB6+goUiNApm3ySGkGj2kVj3x5MEB4cQQGllccq/YZHQ9nqE702tmLK g==; X-IronPort-AV: E=McAfee;i="6500,9779,10485"; a="299756640" X-IronPort-AV: E=Sophos;i="5.93,358,1654585200"; d="scan'208";a="299756640" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Sep 2022 02:58:56 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10485"; a="711743764" X-IronPort-AV: E=Sophos;i="5.93,358,1654585200"; d="scan'208";a="711743764" Received: from intel-latitude-e5450.iind.intel.com ([10.224.186.32]) by FMSMGA003.fm.intel.com with ESMTP; 30 Sep 2022 02:58:55 -0700 From: Sathish Narasimman To: linux-bluetooth@vger.kernel.org Cc: Sathish Narasimman Subject: [PATCH 3/3] profiles: Register callback function to update volume Date: Sat, 1 Oct 2022 00:19:54 +0530 Message-Id: <20220930184954.108937-3-sathish.narasimman@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220930184954.108937-1-sathish.narasimman@intel.com> References: <20220930184954.108937-1-sathish.narasimman@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00,DATE_IN_FUTURE_06_12, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Callback function has to be registered to call media_transport_update_device_volume to change transport volume. --- profiles/audio/vcp.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/profiles/audio/vcp.c b/profiles/audio/vcp.c index b42b0a4f79dd..4b790b03c032 100644 --- a/profiles/audio/vcp.c +++ b/profiles/audio/vcp.c @@ -50,6 +50,7 @@ #include "src/service.h" #include "src/log.h" #include "src/error.h" +#include "transport.h" #define VCS_UUID_STR "00001844-0000-1000-8000-00805f9b34fb" #define MEDIA_ENDPOINT_INTERFACE "org.bluez.MediaEndpoint1" @@ -83,6 +84,20 @@ static struct vcp_data *vcp_data_new(struct btd_device *device) return data; } +static void vr_set_volume(struct bt_vcp *vcp, int8_t volume, void *data) +{ + struct vcp_data *user_data = data; + struct btd_device *device = user_data->device; + + DBG("set volume"); + + media_transport_update_device_volume(device, volume); +} + +static struct bt_vcp_vr_ops vcp_vr_ops = { + .set_volume = vr_set_volume, +}; + static void vcp_data_add(struct vcp_data *data) { DBG("data %p", data); @@ -94,6 +109,7 @@ static void vcp_data_add(struct vcp_data *data) bt_vcp_set_debug(data->vcp, vcp_debug, NULL, NULL); + bt_vcp_vr_set_ops(data->vcp, &vcp_vr_ops, data); if (!sessions) sessions = queue_new(); @@ -178,6 +194,7 @@ static void vcp_attached(struct bt_vcp *vcp, void *user_data) data->vcp = vcp; vcp_data_add(data); + } static int vcp_probe(struct btd_service *service) -- 2.25.1