Deleted Added
full compact
exynos5_i2c.c (263936) exynos5_i2c.c (266945)
1/*-
2 * Copyright (c) 2014 Ruslan Bukin <br@bsdpad.com>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 16 unchanged lines hidden (view full) ---

25 */
26
27/*
28 * Samsung Exynos 5 Inter-Integrated Circuit (I2C)
29 * Chapter 13, Exynos 5 Dual User's Manual Public Rev 1.00
30 */
31
32#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2014 Ruslan Bukin <br@bsdpad.com>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 16 unchanged lines hidden (view full) ---

25 */
26
27/*
28 * Samsung Exynos 5 Inter-Integrated Circuit (I2C)
29 * Chapter 13, Exynos 5 Dual User's Manual Public Rev 1.00
30 */
31
32#include <sys/cdefs.h>
33__FBSDID("$FreeBSD: head/sys/arm/samsung/exynos/exynos5_i2c.c 263936 2014-03-30 15:22:36Z br $");
33__FBSDID("$FreeBSD: head/sys/arm/samsung/exynos/exynos5_i2c.c 266945 2014-06-01 08:45:27Z br $");
34
35#include <sys/param.h>
36#include <sys/systm.h>
37#include <sys/bus.h>
38#include <sys/kernel.h>
39#include <sys/module.h>
40#include <sys/malloc.h>
41#include <sys/rman.h>

--- 325 unchanged lines hidden (view full) ---

367 reg |= (I2CMODE_MR << I2CMODE_S);
368 reg |= I2C_START_STOP;
369 WRITE1(sc, I2CSTAT, reg);
370
371 *read = 0;
372 mtx_lock(&sc->mutex);
373
374 /* dummy read */
34
35#include <sys/param.h>
36#include <sys/systm.h>
37#include <sys/bus.h>
38#include <sys/kernel.h>
39#include <sys/module.h>
40#include <sys/malloc.h>
41#include <sys/rman.h>

--- 325 unchanged lines hidden (view full) ---

367 reg |= (I2CMODE_MR << I2CMODE_S);
368 reg |= I2C_START_STOP;
369 WRITE1(sc, I2CSTAT, reg);
370
371 *read = 0;
372 mtx_lock(&sc->mutex);
373
374 /* dummy read */
375 clear_ipend(sc);
376 error = wait_for_iif(sc);
377 if (error) {
378 DPRINTF("cant i2c read: iif error\n");
379 mtx_unlock(&sc->mutex);
380 return (error);
381 }
375 READ1(sc, I2CDS);
376
377 DPRINTF("Read ");
378 while (*read < len) {
379
380 /* Do not ack last read */
381 if (*read == (len - 1)) {
382 reg = READ1(sc, I2CCON);

--- 94 unchanged lines hidden ---
382 READ1(sc, I2CDS);
383
384 DPRINTF("Read ");
385 while (*read < len) {
386
387 /* Do not ack last read */
388 if (*read == (len - 1)) {
389 reg = READ1(sc, I2CCON);

--- 94 unchanged lines hidden ---