mhi.h (047298203fc3bc2b290f44b9531a7b7d553fe9b7) mhi.h (bee50f894b9e0b51668c83e24bf2ec7c275725eb)
1/*-
2 * SPDX-License-Identifier: BSD-2-Clause
3 *
4 * Copyright (c) 2022-2023 Bjoern A. Zeeb
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 49 unchanged lines hidden (view full) ---

58struct mhi_event_config {
59 int client_managed, data_type, hardware_event, irq, irq_moderation_ms, mode, num_elements, offload_channel, priority;
60};
61
62struct mhi_device {
63};
64
65struct mhi_controller_config {
1/*-
2 * SPDX-License-Identifier: BSD-2-Clause
3 *
4 * Copyright (c) 2022-2023 Bjoern A. Zeeb
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 49 unchanged lines hidden (view full) ---

58struct mhi_event_config {
59 int client_managed, data_type, hardware_event, irq, irq_moderation_ms, mode, num_elements, offload_channel, priority;
60};
61
62struct mhi_device {
63};
64
65struct mhi_controller_config {
66 struct mhi_channel_config *ch_cfg;
66 const struct mhi_channel_config *ch_cfg;
67 struct mhi_event_config *event_cfg;
68
69 int buf_len, max_channels, num_channels, num_events, use_bounce_buf;
70
71 uint32_t timeout_ms;
72};
73
74struct mhi_controller {

--- 22 unchanged lines hidden (view full) ---

97 void (*write_reg)(struct mhi_controller *, void __iomem *, uint32_t);
98};
99
100/* -------------------------------------------------------------------------- */
101
102struct mhi_controller *linuxkpi_mhi_alloc_controller(void);
103void linuxkpi_mhi_free_controller(struct mhi_controller *);
104int linuxkpi_mhi_register_controller(struct mhi_controller *,
67 struct mhi_event_config *event_cfg;
68
69 int buf_len, max_channels, num_channels, num_events, use_bounce_buf;
70
71 uint32_t timeout_ms;
72};
73
74struct mhi_controller {

--- 22 unchanged lines hidden (view full) ---

97 void (*write_reg)(struct mhi_controller *, void __iomem *, uint32_t);
98};
99
100/* -------------------------------------------------------------------------- */
101
102struct mhi_controller *linuxkpi_mhi_alloc_controller(void);
103void linuxkpi_mhi_free_controller(struct mhi_controller *);
104int linuxkpi_mhi_register_controller(struct mhi_controller *,
105 struct mhi_controller_config *);
105 const struct mhi_controller_config *);
106void linuxkpi_mhi_unregister_controller(struct mhi_controller *);
107
108/* -------------------------------------------------------------------------- */
109
110static inline struct mhi_controller *
111mhi_alloc_controller(void)
112{
113

--- 5 unchanged lines hidden (view full) ---

119mhi_free_controller(struct mhi_controller *mhi_ctrl)
120{
121
122 linuxkpi_mhi_free_controller(mhi_ctrl);
123}
124
125static inline int
126mhi_register_controller(struct mhi_controller *mhi_ctrl,
106void linuxkpi_mhi_unregister_controller(struct mhi_controller *);
107
108/* -------------------------------------------------------------------------- */
109
110static inline struct mhi_controller *
111mhi_alloc_controller(void)
112{
113

--- 5 unchanged lines hidden (view full) ---

119mhi_free_controller(struct mhi_controller *mhi_ctrl)
120{
121
122 linuxkpi_mhi_free_controller(mhi_ctrl);
123}
124
125static inline int
126mhi_register_controller(struct mhi_controller *mhi_ctrl,
127 struct mhi_controller_config *cfg)
127 const struct mhi_controller_config *cfg)
128{
129
130 return (linuxkpi_mhi_register_controller(mhi_ctrl, cfg));
131}
132
133static inline void
134mhi_unregister_controller(struct mhi_controller *mhi_ctrl)
135{

--- 56 unchanged lines hidden (view full) ---

192static __inline int
193mhi_pm_suspend(struct mhi_controller *mhi_ctrl)
194{
195 /* XXX TODO */
196 return (0);
197}
198
199static __inline int
128{
129
130 return (linuxkpi_mhi_register_controller(mhi_ctrl, cfg));
131}
132
133static inline void
134mhi_unregister_controller(struct mhi_controller *mhi_ctrl)
135{

--- 56 unchanged lines hidden (view full) ---

192static __inline int
193mhi_pm_suspend(struct mhi_controller *mhi_ctrl)
194{
195 /* XXX TODO */
196 return (0);
197}
198
199static __inline int
200mhi_pm_resume(struct mhi_controller *mhi_ctrl)
201{
202 /* XXX TODO */
203 return (0);
204}
205
206static __inline int
200mhi_pm_resume_force(struct mhi_controller *mhi_ctrl)
201{
202 /* XXX TODO */
203 return (0);
204}
205
206/* -------------------------------------------------------------------------- */
207
208static __inline int
209mhi_force_rddm_mode(struct mhi_controller *mhi_ctrl)
210{
211 /* XXX TODO */
212 return (0);
213}
214
215#endif /* _LINUXKPI_LINUX_MHI_H */
207mhi_pm_resume_force(struct mhi_controller *mhi_ctrl)
208{
209 /* XXX TODO */
210 return (0);
211}
212
213/* -------------------------------------------------------------------------- */
214
215static __inline int
216mhi_force_rddm_mode(struct mhi_controller *mhi_ctrl)
217{
218 /* XXX TODO */
219 return (0);
220}
221
222#endif /* _LINUXKPI_LINUX_MHI_H */