Files
OpenCellular/include/i2c_arbitration.h
Randall Spangler 34e17d4c05 Move I2C arbitration to its own file
It's only board-specific in that we've only needed it on snow so far.
But by that logic, x86_power would be board specific because we've
only needed it on link.

No functionality change, just moving code between files and renaming
the interface to indicate it's not board-specific.

BUG=chrome-os-partner:18343
BRANCH=none
TEST=build daisy,snow,spring

Change-Id: I35debdaa71829d55a2fbc5d3c62b2aaf6e467633
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/45879
2013-03-20 15:23:29 -07:00

45 lines
1.1 KiB
C

/* Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
/* I2C arbitration for Chrome EC */
#ifndef __CROS_EC_I2C_ARBITRATION_H
#define __CROS_EC_I2C_ARBITRATION_H
#include "common.h"
#ifdef CONFIG_I2C_ARBITRATION
/**
* Claim an I2C port for use in master mode.
*
* If this function succeeds, you must later call i2c_release() to release the
* claim.
*
* This function must not be called to claim an already-claimed port.
*
* @param port Port to claim (0 for first, 1 for second, etc.)
* @return 0 if claimed successfully, -1 if it is in use
*/
int i2c_claim(int port);
/**
* Release an I2C port (after previously being claimed)
*
* This function must not be called to release an already-released port.
*
* @param port Port to claim (0 for first, 1 for second, etc.)
*/
void i2c_release(int port);
#else
static inline int i2c_claim(int port) { return EC_SUCCESS; }
static inline void i2c_release(int port) {}
#endif
#endif /* __CROS_EC_I2C_ARBITRATION_H */