From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752141AbbFBWY1 (ORCPT ); Tue, 2 Jun 2015 18:24:27 -0400 Received: from mail-ig0-f176.google.com ([209.85.213.176]:36979 "EHLO mail-ig0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750922AbbFBWYV (ORCPT ); Tue, 2 Jun 2015 18:24:21 -0400 From: Ben Zhang To: Mark Brown Cc: Omair Mohammed Abdullah , Vinod Koul , Dylan Reid , Ben Zhang , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: [PATCH] ASoC: core: Pass kcontrol pointer to bytes tlv callbacks Date: Tue, 2 Jun 2015 15:24:03 -0700 Message-Id: <1433283843-33856-1-git-send-email-benzh@chromium.org> X-Mailer: git-send-email 2.2.0.rc0.207.ga3a616c Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The get/put callbacks need the kcontrol pointer to get context information like snd_soc_codec and drvdata. Signed-off-by: Ben Zhang --- include/sound/soc.h | 6 ++++-- sound/soc/soc-ops.c | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/include/sound/soc.h b/include/sound/soc.h index fcb312b..404265d 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -1169,8 +1169,10 @@ struct soc_bytes { struct soc_bytes_ext { int max; /* used for TLV byte control */ - int (*get)(unsigned int __user *bytes, unsigned int size); - int (*put)(const unsigned int __user *bytes, unsigned int size); + int (*get)(struct snd_kcontrol *kcontrol, + unsigned int __user *bytes, unsigned int size); + int (*put)(struct snd_kcontrol *kcontrol, + const unsigned int __user *bytes, unsigned int size); }; /* multi register control */ diff --git a/sound/soc/soc-ops.c b/sound/soc/soc-ops.c index 100d92b..7f53da9 100644 --- a/sound/soc/soc-ops.c +++ b/sound/soc/soc-ops.c @@ -751,11 +751,11 @@ int snd_soc_bytes_tlv_callback(struct snd_kcontrol *kcontrol, int op_flag, switch (op_flag) { case SNDRV_CTL_TLV_OP_READ: if (params->get) - ret = params->get(tlv, count); + ret = params->get(kcontrol, tlv, count); break; case SNDRV_CTL_TLV_OP_WRITE: if (params->put) - ret = params->put(tlv, count); + ret = params->put(kcontrol, tlv, count); break; } return ret; -- 2.2.0.rc0.207.ga3a616c