smiapp-regs.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. * include/media/smiapp/smiapp-regs.h
  3. *
  4. * Generic driver for SMIA/SMIA++ compliant camera modules
  5. *
  6. * Copyright (C) 2011--2012 Nokia Corporation
  7. * Contact: Sakari Ailus <sakari.ailus@iki.fi>
  8. *
  9. * This program is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU General Public License
  11. * version 2 as published by the Free Software Foundation.
  12. *
  13. * This program is distributed in the hope that it will be useful, but
  14. * WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. * General Public License for more details.
  17. */
  18. #ifndef SMIAPP_REGS_H
  19. #define SMIAPP_REGS_H
  20. #include <linux/i2c.h>
  21. #include <linux/types.h>
  22. #define SMIAPP_REG_ADDR(reg) ((u16)reg)
  23. #define SMIAPP_REG_WIDTH(reg) ((u8)(reg >> 16))
  24. #define SMIAPP_REG_FLAGS(reg) ((u8)(reg >> 24))
  25. /* Use upper 8 bits of the type field for flags */
  26. #define SMIAPP_REG_FLAG_FLOAT (1 << 24)
  27. #define SMIAPP_REG_8BIT 1
  28. #define SMIAPP_REG_16BIT 2
  29. #define SMIAPP_REG_32BIT 4
  30. struct smiapp_sensor;
  31. int smiapp_read_no_quirk(struct smiapp_sensor *sensor, u32 reg, u32 *val);
  32. int smiapp_read(struct smiapp_sensor *sensor, u32 reg, u32 *val);
  33. int smiapp_read_8only(struct smiapp_sensor *sensor, u32 reg, u32 *val);
  34. int smiapp_write_no_quirk(struct smiapp_sensor *sensor, u32 reg, u32 val);
  35. int smiapp_write(struct smiapp_sensor *sensor, u32 reg, u32 val);
  36. #endif