Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp4034527pxk; Tue, 8 Sep 2020 09:02:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzQP1MKPdL69JOGWBmSFxQ4qr4fmmSMJ6RHWYIzirgPZSdWUEx8z4iP2OUrgpIMaeoAcZ1O X-Received: by 2002:a17:906:cf9d:: with SMTP id um29mr26327375ejb.74.1599580956687; Tue, 08 Sep 2020 09:02:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599580956; cv=none; d=google.com; s=arc-20160816; b=PBtiaCc1xywRWu8kYJzE+BeYoiFuWZTU3a4hwH8Cpr1/FIQGIp83y9zsX5GnRkwNW4 N2y5MktSrXQVSuJFjJSpwVRL+rV+dGIflMNlypDJpwQ+GFm3OG3Q9kWrVEHX6qjPVoPg EOcu9ilJ09s/Io9E/nilsFg/5MOnflWNd0NISFYW5ax/DdAJJUJv5COk3gArDD1yGN53 9BF5yrt0l7iO+f1lbiZL+HDx9zTpt8Bf56wqWDWeFf6gDiqhaoPdZnmJoPMzfHPI15mj d0fdXc2DVn+hkyn+ZQEcKB7WgamL3mPWiQDJPGttXrwrAV9RIERNZBBT5f0uzCMulLA+ fYeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=lTBu5eojvtH3Cg+6qbTtorcKtib9FdmKFYP+6u1ZlTM=; b=SU8GlqWWYVO8uLkL7wan/B63GQZ/5eUc/Rc5wHbdoImHZkRxeShEClQUrF+BE0l0Le xp1ojlUrXpGeaR1nahK/4PdLEuFSrLWLipHrUCT37jr12l1tnRzLj4YSKTGgmWVnblku c1UZJ9nb9WapIHyzlrNLvSBH18m15ef5wOIC9W2r/m3qzkiNqGYX17WHiHnTOLY8GrJo +pLqDSL4b6mRGh0l4urR6AyF9sxpJ0Wk8u3ufKvP+YrBDqkEGMZbW+x6sFfeATKbWbbS R4XdXJd2sOZb+TGGXZYLaniDkNf2fBl7TSgRDmrhkrpUXIyi8UjcTYc056D8ctz12nIn wsZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@marek-ca.20150623.gappssmtp.com header.s=20150623 header.b=AvXioZY1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id mb24si11925357ejb.583.2020.09.08.09.02.11; Tue, 08 Sep 2020 09:02:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@marek-ca.20150623.gappssmtp.com header.s=20150623 header.b=AvXioZY1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731090AbgIHQAk (ORCPT + 99 others); Tue, 8 Sep 2020 12:00:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53402 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730940AbgIHPyo (ORCPT ); Tue, 8 Sep 2020 11:54:44 -0400 Received: from mail-qt1-x842.google.com (mail-qt1-x842.google.com [IPv6:2607:f8b0:4864:20::842]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4752CC061244 for ; Tue, 8 Sep 2020 06:11:34 -0700 (PDT) Received: by mail-qt1-x842.google.com with SMTP id k25so10836066qtu.4 for ; Tue, 08 Sep 2020 06:11:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marek-ca.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=lTBu5eojvtH3Cg+6qbTtorcKtib9FdmKFYP+6u1ZlTM=; b=AvXioZY1lrRFV29Rd2bQ+oc4u+i4TYWLNkpUwEfCglPKplw2Peh96WxLh8HLEfOPwl 3eKVoXUefH+2pse10GxAwhD8vKo1iM5YDgnqKsOJnVJ511Hs6Ka4cd6ckiexxEbOmz7+ EJVN/uvWsKXCp3mcPPOQFFQFc/aIYAj8sV/0u/XW9oCCRuJ02rcWOuLm4KCY/UorBWxV ii+HldpZFmE1g9k5anDMfc/Xn5Rfb30DchkgRbcEHLcj+JJllzamtml4CtPTYV07O0W4 sDSCvDlJXmQtA8HEbcn9CkRhgVPrWwIfoeQ4GQBFejCbKgm9VagHSYYaOTzfC9mTRr9U G3Zg== 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:mime-version:content-transfer-encoding; bh=lTBu5eojvtH3Cg+6qbTtorcKtib9FdmKFYP+6u1ZlTM=; b=R46RTw2axgXx6c7GNg4OZwliaxidXGhAMpZ5Xg0PFtkNIixATAtjvgbq+KOxv1yNGv 7fvRsOAkUPIoNMjUgGt+8deSykZKIKN0yrCYbobeGFgJbpHykGc4LJY4H7TYVVePiT50 cYqlRtjUM6thh2E128mWudpxVOF5aRjx2RcjBDGsp5IGFmPSp7kvgUS/dQwWTaDq1RtI xW1jIZ+smd6aHWCJtHtFHlxcWAyHYqXS427X3dcOasCxVC2/9GbYHIR4oZ4ynN2Srp37 Vkfp5pmdYrCURIXfT8DtAUoK/2+1uZxMI+lhQ2UK3hRzOoIUatpNenW8bARhwHEncvYC zneg== X-Gm-Message-State: AOAM531Gqc133EI8QFoLAtF4aV4cO5kGBO7rVXHIKUlKvKKtBEJyUxwB wrm3YnYisKUcjMTIGgT41Dujhg== X-Received: by 2002:ac8:4d05:: with SMTP id w5mr16846175qtv.339.1599570693504; Tue, 08 Sep 2020 06:11:33 -0700 (PDT) Received: from localhost.localdomain ([147.253.86.153]) by smtp.gmail.com with ESMTPSA id m196sm13394069qke.87.2020.09.08.06.11.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Sep 2020 06:11:32 -0700 (PDT) From: Jonathan Marek To: linux-arm-msm@vger.kernel.org Cc: Arnd Bergmann , Greg Kroah-Hartman , Srinivas Kandagatla , Jorge Ramirez-Ortiz , linux-kernel@vger.kernel.org (open list) Subject: [PATCH v2 3/3] misc: fastrpc: add ioctl for attaching to sensors pd Date: Tue, 8 Sep 2020 09:10:11 -0400 Message-Id: <20200908131013.19630-4-jonathan@marek.ca> X-Mailer: git-send-email 2.26.1 In-Reply-To: <20200908131013.19630-1-jonathan@marek.ca> References: <20200908131013.19630-1-jonathan@marek.ca> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Initializing sensors requires attaching to pd 2. Add an ioctl for that. This corresponds to FASTRPC_INIT_ATTACH_SENSORS in the downstream driver. Signed-off-by: Jonathan Marek --- drivers/misc/fastrpc.c | 9 ++++++--- include/uapi/misc/fastrpc.h | 1 + 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c index 07b381c042cd..f05f4b5934bd 100644 --- a/drivers/misc/fastrpc.c +++ b/drivers/misc/fastrpc.c @@ -1281,7 +1281,7 @@ static int fastrpc_dmabuf_alloc(struct fastrpc_user *fl, char __user *argp) return 0; } -static int fastrpc_init_attach(struct fastrpc_user *fl) +static int fastrpc_init_attach(struct fastrpc_user *fl, int pd) { struct fastrpc_invoke_args args[1]; int tgid = fl->tgid; @@ -1292,7 +1292,7 @@ static int fastrpc_init_attach(struct fastrpc_user *fl) args[0].fd = -1; args[0].reserved = 0; sc = FASTRPC_SCALARS(FASTRPC_RMID_INIT_ATTACH, 1, 0); - fl->pd = AUDIO_PD; + fl->pd = pd; return fastrpc_internal_invoke(fl, true, FASTRPC_INIT_HANDLE, sc, &args[0]); @@ -1482,7 +1482,10 @@ static long fastrpc_device_ioctl(struct file *file, unsigned int cmd, err = fastrpc_invoke(fl, argp); break; case FASTRPC_IOCTL_INIT_ATTACH: - err = fastrpc_init_attach(fl); + err = fastrpc_init_attach(fl, AUDIO_PD); + break; + case FASTRPC_IOCTL_INIT_ATTACH_SNS: + err = fastrpc_init_attach(fl, SENSORS_PD); break; case FASTRPC_IOCTL_INIT_CREATE: err = fastrpc_init_create_process(fl, argp); diff --git a/include/uapi/misc/fastrpc.h b/include/uapi/misc/fastrpc.h index de31f0bd4779..0a89f95463f6 100644 --- a/include/uapi/misc/fastrpc.h +++ b/include/uapi/misc/fastrpc.h @@ -12,6 +12,7 @@ #define FASTRPC_IOCTL_INIT_CREATE _IOWR('R', 5, struct fastrpc_init_create) #define FASTRPC_IOCTL_MMAP _IOWR('R', 6, struct fastrpc_req_mmap) #define FASTRPC_IOCTL_MUNMAP _IOWR('R', 7, struct fastrpc_req_munmap) +#define FASTRPC_IOCTL_INIT_ATTACH_SNS _IO('R', 8) struct fastrpc_invoke_args { __u64 ptr; -- 2.26.1