Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp2076099rwi; Tue, 11 Oct 2022 04:38:26 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6rDB+4y611WflaXotLAFMWF5DH8MlP6JmS6QFxEdHGD5SBUyJcyzbJbJShrZ9fWO6ghx9b X-Received: by 2002:aa7:c0cf:0:b0:45c:6a06:ea9a with SMTP id j15-20020aa7c0cf000000b0045c6a06ea9amr3251987edp.211.1665488306474; Tue, 11 Oct 2022 04:38:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665488306; cv=none; d=google.com; s=arc-20160816; b=qnsiOEl1bkbpCc799gznWPpKXmEQxP1SGc4Cy5ocET8X3JAOzxUV3FahuM2EZHRo/z KeH5bNII6B9OGmzcXZwrl5WAYAJo1EKHwtg8lPs1+znS0u5YjzCSzhmfNh2AGhTd8w8/ Hd1oMbNR0J7X41rOhQSKpgE06cyrlQkL6AJaDwW7+T62hLkSMMua8phGa1nyI35sEX4g jiNGh4PVxL1hBUzhxOmj/QGzS6ydi0mECfVEGm0/M1P7K0cSTXZ2I4xOJTInIpzoARR0 JiNbmRvUZBwBOhhkf82erxmPgMr0sjUeyF9iADB/uwes8/yM8dxMJdA/aip2M8v7e5Ar mnnw== 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=crDj/6Ikwj6NR1gfFdBNWgHwNfO8lTbY8hfqlX9YKY7emyJUEaCkFDz/4wPO3SKMrG MAq4wY8cDH5ULC7VoQGxR/2QU/ZSfc1i1v2d0bGK2cRR3eiDJpT6/i375hqJpPs3EogQ ZjtZ0SEQgsPh5uDg+vTRExeqXVq3Eu7Fo6chXrt6K6sKX+ZlQR2NLXqFvymb0qDyihkY /diaP7DlQyusmc0uQnjEtnICh1rblHHOoOIEJgXRg3mHhacF2sFVaTW67m+Cse+ZJdmd ig6YjmynVcDzef8Rgfc5zThbFU+cceBLmwlC9JMqj1/JVjrZnxgqmJv96r3FjbsugHOO bN4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=hE3XF0Nt; 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 m12-20020a056402430c00b0045856855250si16289150edc.256.2022.10.11.04.37.57; Tue, 11 Oct 2022 04:38:26 -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=hE3XF0Nt; 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 S229872AbiJKLac (ORCPT + 99 others); Tue, 11 Oct 2022 07:30:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38836 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229889AbiJKLa1 (ORCPT ); Tue, 11 Oct 2022 07:30:27 -0400 Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A54F478213 for ; Tue, 11 Oct 2022 04:30:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1665487825; x=1697023825; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=weArQEE1+BAZ7Td37iXcT7Dn5h69cCu0jphqGbByJuE=; b=hE3XF0NtTFkAcJb2i+GrgjBaBKS877mzGffdLQFnCOkww/UIlqszzqZu zXjC77Sf9uOLX89wOSJqj1uFmnt1+NOE8VPL2t+Y5Hq+9ToH/Ft+YJC1X vBzw9s8yfUt4ukHEpm+oAaKy5K0XvwebRMKuxzdNN7oA3SHICarWhueLs 7DJjCAQeYHWS8PtDRZ07UCcBUDYgBJmlwZRFYPRwmfRXfsRbJuEBSmR0t QK+Hyi5HEHjuCi12WyR17qnblb4bWRk+pJEOwmjR4JOQkOmOw34ybRGUY CDl7YUH9VXtGAAChgxeFULtdHUSELJRWzes6fOWcxwMEGBBMJj3oY1/Xn Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10496"; a="366469746" X-IronPort-AV: E=Sophos;i="5.95,176,1661842800"; d="scan'208";a="366469746" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Oct 2022 04:30:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10496"; a="577406222" X-IronPort-AV: E=Sophos;i="5.95,176,1661842800"; d="scan'208";a="577406222" Received: from intel-latitude-e5450.iind.intel.com ([10.224.186.32]) by orsmga003.jf.intel.com with ESMTP; 11 Oct 2022 04:30:21 -0700 From: Sathish Narasimman To: linux-bluetooth@vger.kernel.org Cc: Sathish Narasimman Subject: [PATCH BlueZ v3 3/3] profiles: Register callback function to update volume Date: Tue, 11 Oct 2022 17:01:16 +0530 Message-Id: <20221011113116.70514-3-sathish.narasimman@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221011113116.70514-1-sathish.narasimman@intel.com> References: <20221011113116.70514-1-sathish.narasimman@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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