Changeset 42bf1b9 in rtems for cpukit/libi2c


Ignore:
Timestamp:
May 15, 2008, 3:10:38 PM (12 years ago)
Author:
Thomas Doerfler <Thomas.Doerfler@…>
Branches:
4.10, 4.11, 4.9, master
Children:
e0abba9
Parents:
8ac748c
Message:

adapted gen83xx to new board

Location:
cpukit/libi2c
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpukit/libi2c/libi2c.c

    r8ac748c r42bf1b9  
    577577  int sc = 0;
    578578  void *args;
     579  boolean is_started = FALSE;
    579580  DECL_CHECKED_BH (busno, bush, minor, -)
    580 
    581     if (not_started (busno))
    582     return -RTEMS_NOT_OWNER_OF_RESOURCE;
    583 
     581   
    584582  va_start(ap, cmd);
    585583  args = va_arg(ap, void *);
     
    590588     */
    591589   
     590  case RTEMS_LIBI2C_IOCTL_GET_DRV_T:
     591    /*
     592     * query driver table entry
     593     */
     594    *(rtems_libi2c_drv_t **)args = (drvs[MINOR2DRV(minor)-1].drv);
     595    break;
     596
    592597  case RTEMS_LIBI2C_IOCTL_START_TFM_READ_WRITE:
     598    if (not_started (busno))
     599      return -RTEMS_NOT_OWNER_OF_RESOURCE;
     600
    593601    /*
    594602     * address device, then set transfer mode and perform read_write transfer
     
    599607    if (sc == 0) {
    600608      sc = rtems_libi2c_send_start (minor);
     609      is_started = (sc == 0);
    601610    }
    602611    /*
     
    618627         &((rtems_libi2c_tfm_read_write_t *)args)->rd_wr);
    619628    }
     629    if ((sc < 0) && (is_started)) {
     630      rtems_libi2c_send_stop (minor);
     631    }
    620632    break;
    621633  default:
     
    623635    break;
    624636  }
    625   if (sc < 0)
    626     rtems_libi2c_send_stop (minor);
    627   return sc;
     637    return sc;
    628638}
    629639
  • cpukit/libi2c/libi2c.h

    r8ac748c r42bf1b9  
    414414 */
    415415
    416 /*
    417  * arguemtn data structures for IOCTLs defined above
     416#define RTEMS_LIBI2C_IOCTL_GET_DRV_T 4
     417/*
     418 * retval = rtems_libi2c_ioctl(rtems_device_minor_number minor,
     419 *                             RTEMS_LIBI2C_IOCTL_GET_DRV_T,
     420 *                             const rtems_libi2c_drv_t *drv_t_ptr);
     421 *
     422 * This call allows the a high-level driver to query its driver table entry,
     423 * including its private data appended to it during creation of the entry
     424 *
     425 */
     426
     427/*
     428 * argument data structures for IOCTLs defined above
    418429 */
    419430typedef struct {
Note: See TracChangeset for help on using the changeset viewer.