linux/drivers/gpu/drm/i915/display/intel_gmbus.h

/* SPDX-License-Identifier: MIT */
/*
 * Copyright © 2019 Intel Corporation
 */

#ifndef __INTEL_GMBUS_H__
#define __INTEL_GMBUS_H__

#include <linux/types.h>

struct drm_i915_private;
struct i2c_adapter;

#define GMBUS_PIN_DISABLED
#define GMBUS_PIN_SSC
#define GMBUS_PIN_VGADDC
#define GMBUS_PIN_PANEL
#define GMBUS_PIN_DPD_CHV
#define GMBUS_PIN_DPC
#define GMBUS_PIN_DPB
#define GMBUS_PIN_DPD
#define GMBUS_PIN_RESERVED
#define GMBUS_PIN_1_BXT
#define GMBUS_PIN_2_BXT
#define GMBUS_PIN_3_BXT
#define GMBUS_PIN_4_CNP
#define GMBUS_PIN_5_MTP
#define GMBUS_PIN_9_TC1_ICP
#define GMBUS_PIN_10_TC2_ICP
#define GMBUS_PIN_11_TC3_ICP
#define GMBUS_PIN_12_TC4_ICP
#define GMBUS_PIN_13_TC5_TGP
#define GMBUS_PIN_14_TC6_TGP

#define GMBUS_NUM_PINS

int intel_gmbus_setup(struct drm_i915_private *dev_priv);
void intel_gmbus_teardown(struct drm_i915_private *dev_priv);
bool intel_gmbus_is_valid_pin(struct drm_i915_private *dev_priv,
			      unsigned int pin);
int intel_gmbus_output_aksv(struct i2c_adapter *adapter);

struct i2c_adapter *
intel_gmbus_get_adapter(struct drm_i915_private *dev_priv, unsigned int pin);
void intel_gmbus_force_bit(struct i2c_adapter *adapter, bool force_bit);
bool intel_gmbus_is_forced_bit(struct i2c_adapter *adapter);
void intel_gmbus_reset(struct drm_i915_private *dev_priv);

void intel_gmbus_irq_handler(struct drm_i915_private *i915);

#endif /* __INTEL_GMBUS_H__ */