Path: blob/master/drivers/gpu/drm/nouveau/nouveau_i2c.h
15112 views
/*1* Copyright 2009 Red Hat Inc.2*3* Permission is hereby granted, free of charge, to any person obtaining a4* copy of this software and associated documentation files (the "Software"),5* to deal in the Software without restriction, including without limitation6* the rights to use, copy, modify, merge, publish, distribute, sublicense,7* and/or sell copies of the Software, and to permit persons to whom the8* Software is furnished to do so, subject to the following conditions:9*10* The above copyright notice and this permission notice shall be included in11* all copies or substantial portions of the Software.12*13* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR14* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,15* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL16* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR17* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,18* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR19* OTHER DEALINGS IN THE SOFTWARE.20*/2122#ifndef __NOUVEAU_I2C_H__23#define __NOUVEAU_I2C_H__2425#include <linux/i2c.h>26#include <linux/i2c-algo-bit.h>27#include "drm_dp_helper.h"2829struct dcb_i2c_entry;3031struct nouveau_i2c_chan {32struct i2c_adapter adapter;33struct drm_device *dev;34struct i2c_algo_bit_data bit;35unsigned rd;36unsigned wr;37unsigned data;38};3940int nouveau_i2c_init(struct drm_device *, struct dcb_i2c_entry *, int index);41void nouveau_i2c_fini(struct drm_device *, struct dcb_i2c_entry *);42struct nouveau_i2c_chan *nouveau_i2c_find(struct drm_device *, int index);43bool nouveau_probe_i2c_addr(struct nouveau_i2c_chan *i2c, int addr);44int nouveau_i2c_identify(struct drm_device *dev, const char *what,45struct i2c_board_info *info,46bool (*match)(struct nouveau_i2c_chan *,47struct i2c_board_info *),48int index);4950extern const struct i2c_algorithm nouveau_dp_i2c_algo;5152#endif /* __NOUVEAU_I2C_H__ */535455