linux/include/linux/greybus/bundle.h

/* SPDX-License-Identifier: GPL-2.0 */
/*
 * Greybus bundles
 *
 * Copyright 2014 Google Inc.
 * Copyright 2014 Linaro Ltd.
 */

#ifndef __BUNDLE_H
#define __BUNDLE_H

#include <linux/types.h>
#include <linux/list.h>
#include <linux/pm_runtime.h>
#include <linux/device.h>

#define BUNDLE_ID_NONE

/* Greybus "public" definitions" */
struct gb_bundle {};
#define to_gb_bundle(d)

/* Greybus "private" definitions" */
struct gb_bundle *gb_bundle_create(struct gb_interface *intf, u8 bundle_id,
				   u8 class);
int gb_bundle_add(struct gb_bundle *bundle);
void gb_bundle_destroy(struct gb_bundle *bundle);

/* Bundle Runtime PM wrappers */
#ifdef CONFIG_PM
static inline int gb_pm_runtime_get_sync(struct gb_bundle *bundle)
{}

static inline int gb_pm_runtime_put_autosuspend(struct gb_bundle *bundle)
{}

static inline void gb_pm_runtime_get_noresume(struct gb_bundle *bundle)
{}

static inline void gb_pm_runtime_put_noidle(struct gb_bundle *bundle)
{}

#else
static inline int gb_pm_runtime_get_sync(struct gb_bundle *bundle)
{ return 0; }
static inline int gb_pm_runtime_put_autosuspend(struct gb_bundle *bundle)
{ return 0; }

static inline void gb_pm_runtime_get_noresume(struct gb_bundle *bundle) {}
static inline void gb_pm_runtime_put_noidle(struct gb_bundle *bundle) {}
#endif

#endif /* __BUNDLE_H */