text: /* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved.
   *
   * This program is free software; you can redistribute it and/or modify
   * it under the terms of the GNU General Public License version 2 and
   * only version 2 as published by the Free Software Foundation.
   *
   * This program is distributed in the hope that it will be useful,
   * but WITHOUT ANY WARRANTY; without even the implied warranty of
   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   * GNU General Public License for more details.
   */
  
  #ifndef MSM_CSIPHY_H
  #define MSM_CSIPHY_H
  
  #include <linux/clk.h>
  #include <linux/io.h>
  #include <linux/platform_device.h>
  #include <media/v4l2-subdev.h>
  #include <media/msm_cam_sensor.h>
  #include "msm_sd.h"
  
  #define MAX_CSIPHY 3
  #define CSIPHY_NUM_CLK_MAX  16
  
  enum msm_csiphy_state_t {
  	CSIPHY_POWER_UP,
  	CSIPHY_POWER_DOWN,
  };
  
  struct csiphy_device {
  	struct platform_device *pdev;
  	struct msm_sd_subdev msm_sd;
  	struct v4l2_subdev subdev;
  	struct resource *mem;
  	struct resource *clk_mux_mem;
  	struct resource *irq;
  	struct resource *io;
  	struct resource *clk_mux_io;
  	void __iomem *base;
  	void __iomem *clk_mux_base;
  	struct mutex mutex;
  	uint32_t hw_version;
  	enum msm_csiphy_state_t csiphy_state;
  	struct clk *csiphy_clk[CSIPHY_NUM_CLK_MAX];
  	uint8_t ref_count;
  	uint16_t lane_mask[MAX_CSIPHY];
  };
  
  #define VIDIOC_MSM_CSIPHY_RELEASE \
  	_IOWR('V', BASE_VIDIOC_PRIVATE + 9, void *)
  #endif
  