ov5647.c (eadcbfa58ae8693f0d6a0f591d8f51d55cf068e1) | ov5647.c (859969b38e2e9352f0227e1ef0be1dff4a3b7299) |
---|---|
1/* 2 * A V4L2 driver for OmniVision OV5647 cameras. 3 * 4 * Based on Samsung S5K6AAFX SXGA 1/6" 1.3M CMOS Image Sensor driver 5 * Copyright (C) 2011 Sylwester Nawrocki <s.nawrocki@samsung.com> 6 * 7 * Based on Omnivision OV7670 Camera Driver 8 * Copyright (C) 2006-7 Jonathan Corbet <corbet@lwn.net> --- 11 unchanged lines hidden (view full) --- 20 */ 21 22#include <linux/clk.h> 23#include <linux/delay.h> 24#include <linux/i2c.h> 25#include <linux/init.h> 26#include <linux/io.h> 27#include <linux/module.h> | 1/* 2 * A V4L2 driver for OmniVision OV5647 cameras. 3 * 4 * Based on Samsung S5K6AAFX SXGA 1/6" 1.3M CMOS Image Sensor driver 5 * Copyright (C) 2011 Sylwester Nawrocki <s.nawrocki@samsung.com> 6 * 7 * Based on Omnivision OV7670 Camera Driver 8 * Copyright (C) 2006-7 Jonathan Corbet <corbet@lwn.net> --- 11 unchanged lines hidden (view full) --- 20 */ 21 22#include <linux/clk.h> 23#include <linux/delay.h> 24#include <linux/i2c.h> 25#include <linux/init.h> 26#include <linux/io.h> 27#include <linux/module.h> |
28#include <linux/of_graph.h> |
|
28#include <linux/slab.h> 29#include <linux/videodev2.h> 30#include <media/v4l2-device.h> | 29#include <linux/slab.h> 30#include <linux/videodev2.h> 31#include <media/v4l2-device.h> |
32#include <media/v4l2-fwnode.h> |
|
31#include <media/v4l2-image-sizes.h> 32#include <media/v4l2-mediabus.h> | 33#include <media/v4l2-image-sizes.h> 34#include <media/v4l2-mediabus.h> |
33#include <media/v4l2-of.h> | |
34 35#define SENSOR_NAME "ov5647" 36 37#define OV5647_SW_RESET 0x0103 38#define OV5647_REG_CHIPID_H 0x300A 39#define OV5647_REG_CHIPID_L 0x300B 40 41#define REG_TERM 0xfffe --- 463 unchanged lines hidden (view full) --- 505} 506 507static const struct v4l2_subdev_internal_ops ov5647_subdev_internal_ops = { 508 .open = ov5647_open, 509}; 510 511static int ov5647_parse_dt(struct device_node *np) 512{ | 35 36#define SENSOR_NAME "ov5647" 37 38#define OV5647_SW_RESET 0x0103 39#define OV5647_REG_CHIPID_H 0x300A 40#define OV5647_REG_CHIPID_L 0x300B 41 42#define REG_TERM 0xfffe --- 463 unchanged lines hidden (view full) --- 506} 507 508static const struct v4l2_subdev_internal_ops ov5647_subdev_internal_ops = { 509 .open = ov5647_open, 510}; 511 512static int ov5647_parse_dt(struct device_node *np) 513{ |
513 struct v4l2_of_endpoint bus_cfg; | 514 struct v4l2_fwnode_endpoint bus_cfg; |
514 struct device_node *ep; 515 516 int ret; 517 518 ep = of_graph_get_next_endpoint(np, NULL); 519 if (!ep) 520 return -EINVAL; 521 | 515 struct device_node *ep; 516 517 int ret; 518 519 ep = of_graph_get_next_endpoint(np, NULL); 520 if (!ep) 521 return -EINVAL; 522 |
522 ret = v4l2_of_parse_endpoint(ep, &bus_cfg); | 523 ret = v4l2_fwnode_endpoint_parse(of_fwnode_handle(ep), &bus_cfg); |
523 524 of_node_put(ep); 525 return ret; 526} 527 528static int ov5647_probe(struct i2c_client *client, 529 const struct i2c_device_id *id) 530{ --- 104 unchanged lines hidden --- | 524 525 of_node_put(ep); 526 return ret; 527} 528 529static int ov5647_probe(struct i2c_client *client, 530 const struct i2c_device_id *id) 531{ --- 104 unchanged lines hidden --- |