blob: 73e806fe7ce70795d79e3fd237844a3baa5fdcf6 [file] [log] [blame]
Thomas Gleixnerb886d83c2019-06-01 10:08:55 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Hoan Tran866ae692016-06-16 14:09:38 -07002/*
3 * PCC (Platform Communications Channel) methods
Hoan Tran866ae692016-06-16 14:09:38 -07004 */
5
6#ifndef _PCC_H
7#define _PCC_H
8
9#include <linux/mailbox_controller.h>
10#include <linux/mailbox_client.h>
11
Sudeep Holla0f2591e2021-09-17 14:33:49 +010012struct pcc_mbox_chan {
13 struct mbox_chan *mchan;
14 u64 shmem_base_addr;
15 u64 shmem_size;
16 u32 latency;
17 u32 max_access_rate;
18 u16 min_turnaround_time;
19};
20
George Cherianc4b766c2017-10-11 08:54:57 +000021#define MAX_PCC_SUBSPACES 256
Hoan Tran866ae692016-06-16 14:09:38 -070022#ifdef CONFIG_PCC
Sudeep Holla7b6da7f2021-09-17 14:33:50 +010023extern struct pcc_mbox_chan *
24pcc_mbox_request_channel(struct mbox_client *cl, int subspace_id);
25extern void pcc_mbox_free_channel(struct pcc_mbox_chan *chan);
Hoan Tran866ae692016-06-16 14:09:38 -070026#else
Sudeep Holla7b6da7f2021-09-17 14:33:50 +010027static inline struct pcc_mbox_chan *
28pcc_mbox_request_channel(struct mbox_client *cl, int subspace_id)
Hoan Tran866ae692016-06-16 14:09:38 -070029{
Hoan Trand0679cf2016-10-14 16:20:21 -070030 return ERR_PTR(-ENODEV);
Hoan Tran866ae692016-06-16 14:09:38 -070031}
Sudeep Holla7b6da7f2021-09-17 14:33:50 +010032static inline void pcc_mbox_free_channel(struct pcc_mbox_chan *chan) { }
Hoan Tran866ae692016-06-16 14:09:38 -070033#endif
34
35#endif /* _PCC_H */