#include <linux/export.h>
#include <linux/i2c-algo-bit.h>
#include <linux/i2c.h>
#include <drm/display/drm_hdcp_helper.h>
#include "i915_drv.h"
#include "i915_irq.h"
#include "i915_reg.h"
#include "intel_de.h"
#include "intel_display_types.h"
#include "intel_gmbus.h"
#include "intel_gmbus_regs.h"
struct intel_gmbus { … };
enum gmbus_gpio { … };
struct gmbus_pin { … };
static const struct gmbus_pin gmbus_pins[] = …;
static const struct gmbus_pin gmbus_pins_bdw[] = …;
static const struct gmbus_pin gmbus_pins_skl[] = …;
static const struct gmbus_pin gmbus_pins_bxt[] = …;
static const struct gmbus_pin gmbus_pins_cnp[] = …;
static const struct gmbus_pin gmbus_pins_icp[] = …;
static const struct gmbus_pin gmbus_pins_dg1[] = …;
static const struct gmbus_pin gmbus_pins_dg2[] = …;
static const struct gmbus_pin gmbus_pins_mtp[] = …;
static const struct gmbus_pin *get_gmbus_pin(struct drm_i915_private *i915,
unsigned int pin)
{ … }
bool intel_gmbus_is_valid_pin(struct drm_i915_private *i915, unsigned int pin)
{ … }
#define I2C_RISEFALL_TIME …
static inline struct intel_gmbus *
to_intel_gmbus(struct i2c_adapter *i2c)
{ … }
void
intel_gmbus_reset(struct drm_i915_private *i915)
{ … }
static void pnv_gmbus_clock_gating(struct drm_i915_private *i915,
bool enable)
{ … }
static void pch_gmbus_clock_gating(struct drm_i915_private *i915,
bool enable)
{ … }
static void bxt_gmbus_clock_gating(struct drm_i915_private *i915,
bool enable)
{ … }
static u32 get_reserved(struct intel_gmbus *bus)
{ … }
static int get_clock(void *data)
{ … }
static int get_data(void *data)
{ … }
static void set_clock(void *data, int state_high)
{ … }
static void set_data(void *data, int state_high)
{ … }
static int
intel_gpio_pre_xfer(struct i2c_adapter *adapter)
{ … }
static void
intel_gpio_post_xfer(struct i2c_adapter *adapter)
{ … }
static void
intel_gpio_setup(struct intel_gmbus *bus, i915_reg_t gpio_reg)
{ … }
static bool has_gmbus_irq(struct drm_i915_private *i915)
{ … }
static int gmbus_wait(struct drm_i915_private *i915, u32 status, u32 irq_en)
{ … }
static int
gmbus_wait_idle(struct drm_i915_private *i915)
{ … }
static unsigned int gmbus_max_xfer_size(struct drm_i915_private *i915)
{ … }
static int
gmbus_xfer_read_chunk(struct drm_i915_private *i915,
unsigned short addr, u8 *buf, unsigned int len,
u32 gmbus0_reg, u32 gmbus1_index)
{ … }
#define INTEL_GMBUS_BURST_READ_MAX_LEN …
static int
gmbus_xfer_read(struct drm_i915_private *i915, struct i2c_msg *msg,
u32 gmbus0_reg, u32 gmbus1_index)
{ … }
static int
gmbus_xfer_write_chunk(struct drm_i915_private *i915,
unsigned short addr, u8 *buf, unsigned int len,
u32 gmbus1_index)
{ … }
static int
gmbus_xfer_write(struct drm_i915_private *i915, struct i2c_msg *msg,
u32 gmbus1_index)
{ … }
static bool
gmbus_is_index_xfer(struct i2c_msg *msgs, int i, int num)
{ … }
static int
gmbus_index_xfer(struct drm_i915_private *i915, struct i2c_msg *msgs,
u32 gmbus0_reg)
{ … }
static int
do_gmbus_xfer(struct i2c_adapter *adapter, struct i2c_msg *msgs, int num,
u32 gmbus0_source)
{ … }
static int
gmbus_xfer(struct i2c_adapter *adapter, struct i2c_msg *msgs, int num)
{ … }
int intel_gmbus_output_aksv(struct i2c_adapter *adapter)
{ … }
static u32 gmbus_func(struct i2c_adapter *adapter)
{ … }
static const struct i2c_algorithm gmbus_algorithm = …;
static void gmbus_lock_bus(struct i2c_adapter *adapter,
unsigned int flags)
{ … }
static int gmbus_trylock_bus(struct i2c_adapter *adapter,
unsigned int flags)
{ … }
static void gmbus_unlock_bus(struct i2c_adapter *adapter,
unsigned int flags)
{ … }
static const struct i2c_lock_operations gmbus_lock_ops = …;
int intel_gmbus_setup(struct drm_i915_private *i915)
{ … }
struct i2c_adapter *intel_gmbus_get_adapter(struct drm_i915_private *i915,
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_teardown(struct drm_i915_private *i915)
{ … }
void intel_gmbus_irq_handler(struct drm_i915_private *i915)
{ … }