/* * Copyright (c) 2002-2010, Intel Corporation. * Copyright (c) 2014 ATRON electronic GmbH * Author: Jan Safrata <[email protected]> * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * */ #include <linux/delay.h> #include <linux/i2c-algo-bit.h> #include <linux/i2c.h> #include <linux/init.h> #include <linux/io.h> #include <linux/kernel.h> #include <linux/module.h> #include <linux/pci.h> #include <linux/types.h> #include "psb_drv.h" #include "psb_intel_reg.h" /* * LPC GPIO based I2C bus for LVDS of Atom E6xx */ /*----------------------------------------------------------------------------- * LPC Register Offsets. Used for LVDS GPIO Bit Bashing. Registers are part * Atom E6xx [D31:F0] ----------------------------------------------------------------------------*/ #define RGEN … #define RGIO … #define RGLVL … #define RGTPE … #define RGTNE … #define RGGPE … #define RGSMI … #define RGTS … /* The LVDS GPIO clock lines are GPIOSUS[3] * The LVDS GPIO data lines are GPIOSUS[4] */ #define GPIO_CLOCK … #define GPIO_DATA … #define LPC_READ_REG(chan, r) … #define LPC_WRITE_REG(chan, r, val) … 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) { … } struct gma_i2c_chan *oaktrail_lvds_i2c_init(struct drm_device *dev) { … }