Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

misc: fastrpc: add ioctl for attaching to sensors pd

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 <jonathan@marek.ca>
Link: https://lore.kernel.org/r/20200908131013.19630-4-jonathan@marek.ca
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Jonathan Marek and committed by
Greg Kroah-Hartman
6010d9be 84195d20

+7 -3
+6 -3
drivers/misc/fastrpc.c
··· 1281 1281 return 0; 1282 1282 } 1283 1283 1284 - static int fastrpc_init_attach(struct fastrpc_user *fl) 1284 + static int fastrpc_init_attach(struct fastrpc_user *fl, int pd) 1285 1285 { 1286 1286 struct fastrpc_invoke_args args[1]; 1287 1287 int tgid = fl->tgid; ··· 1292 1292 args[0].fd = -1; 1293 1293 args[0].reserved = 0; 1294 1294 sc = FASTRPC_SCALARS(FASTRPC_RMID_INIT_ATTACH, 1, 0); 1295 - fl->pd = AUDIO_PD; 1295 + fl->pd = pd; 1296 1296 1297 1297 return fastrpc_internal_invoke(fl, true, FASTRPC_INIT_HANDLE, 1298 1298 sc, &args[0]); ··· 1482 1482 err = fastrpc_invoke(fl, argp); 1483 1483 break; 1484 1484 case FASTRPC_IOCTL_INIT_ATTACH: 1485 - err = fastrpc_init_attach(fl); 1485 + err = fastrpc_init_attach(fl, AUDIO_PD); 1486 + break; 1487 + case FASTRPC_IOCTL_INIT_ATTACH_SNS: 1488 + err = fastrpc_init_attach(fl, SENSORS_PD); 1486 1489 break; 1487 1490 case FASTRPC_IOCTL_INIT_CREATE: 1488 1491 err = fastrpc_init_create_process(fl, argp);
+1
include/uapi/misc/fastrpc.h
··· 12 12 #define FASTRPC_IOCTL_INIT_CREATE _IOWR('R', 5, struct fastrpc_init_create) 13 13 #define FASTRPC_IOCTL_MMAP _IOWR('R', 6, struct fastrpc_req_mmap) 14 14 #define FASTRPC_IOCTL_MUNMAP _IOWR('R', 7, struct fastrpc_req_munmap) 15 + #define FASTRPC_IOCTL_INIT_ATTACH_SNS _IO('R', 8) 15 16 16 17 struct fastrpc_invoke_args { 17 18 __u64 ptr;