mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2025-09-18 04:11:32 +02:00
Remove <common.h> from this board vendor directory and when needed add missing include files directly. Acked-by: Jason Liu <jason.hui.liu@nxp.com> Acked-by: Peng Fan <peng.fan@nxp.com> Signed-off-by: Tom Rini <trini@konsulko.com>
35 lines
704 B
C
35 lines
704 B
C
// SPDX-License-Identifier: GPL-2.0+
|
|
/*
|
|
* Copyright 2014 Freescale Semiconductor, Inc.
|
|
* Copyright 2020-21 NXP
|
|
* Copyright 2021 Microsoft Corporation
|
|
*/
|
|
|
|
#include <stdio.h>
|
|
#include <i2c.h>
|
|
#include "i2c_common.h"
|
|
|
|
#if CONFIG_IS_ENABLED(DM_I2C)
|
|
|
|
/* If DM is in use, retrieve the chip for the specified bus number */
|
|
int fsl_i2c_get_device(int address, int bus, DEVICE_HANDLE_T *dev)
|
|
{
|
|
int ret = i2c_get_chip_for_busnum(bus, address, 1, dev);
|
|
|
|
if (ret)
|
|
printf("I2C: Bus %d has no device with address 0x%02X\n",
|
|
bus, address);
|
|
return ret;
|
|
}
|
|
|
|
#else
|
|
|
|
/* Handle is passed directly */
|
|
int fsl_i2c_get_device(int address, int bus, DEVICE_HANDLE_T *dev)
|
|
{
|
|
*dev = address;
|
|
return 0;
|
|
}
|
|
|
|
#endif
|