aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManivannan Sadhasivam <manivannan.sadhasivam@linaro.org>2019-06-04 21:55:09 +0530
committerManivannan Sadhasivam <manivannan.sadhasivam@linaro.org>2019-06-04 21:55:09 +0530
commitd4c802a3d2f05498802bfc371df68b6fb2f77360 (patch)
tree7af01f6ee747518ac3ff8cbea831e095768a3994
parent8bdd343f96dc838eefba94a051e84c6db4d1c55d (diff)
download96b-common-db410c_camera.tar.gz
-rw-r--r--arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi40
-rw-r--r--arch/arm64/boot/dts/qcom/msm8916.dtsi14
-rw-r--r--drivers/media/i2c/ov5647.c19
-rw-r--r--drivers/media/platform/qcom/camss/camss-vfe-4-1.c2
-rw-r--r--drivers/media/platform/qcom/camss/camss-vfe.c3
-rw-r--r--drivers/pinctrl/qcom/pinctrl-msm.c23
6 files changed, 88 insertions, 13 deletions
diff --git a/arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi b/arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi
index aac1da4f1d3c..0dc91369f81e 100644
--- a/arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi
+++ b/arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi
@@ -35,6 +35,12 @@
stdout-path = "serial0";
};
+ osc: osc {
+ compatible = "fixed-clock";
+ clock-frequency = <25000000>;
+ #clock-cells = <0>;
+ };
+
reserved-memory {
ramoops@bff00000{
compatible = "ramoops";
@@ -44,6 +50,13 @@
console-size = <0x20000>;
ftrace-size = <0x20000>;
};
+
+ linux,cma {
+ compatible = "shared-dma-pool";
+ reusable;
+ size = <0x00000000 0x08000000>;
+ linux,cma-default;
+ };
};
soc {
@@ -382,9 +395,8 @@
pinctrl-names = "default";
pinctrl-0 = <&camera_rear_default>;
- clocks = <&gcc GCC_CAMSS_MCLK0_CLK>;
- clock-names = "xclk";
- clock-frequency = <23880000>;
+ clocks = <&osc>;
+ clock-frequency = <25000000>;
vdddo-supply = <&camera_vdddo_1v8>;
vdda-supply = <&camera_vdda_2v8>;
@@ -401,6 +413,21 @@
};
};
+ ov: camera@36 {
+ compatible = "ovti,ov5647";
+ reg = <0x36>;
+ clocks = <&osc>;
+ clock-frequency = <25000000>;
+
+ port {
+ ov5647_ep: endpoint {
+ remote-endpoint = <&csiphy0_ep>;
+ clock-lanes = <2>;
+ data-lanes = <0 1>;
+ };
+ };
+ };
+
camera_front@3a {
compatible = "ovti,ov5645";
reg = <0x3a>;
@@ -438,10 +465,9 @@
port@0 {
reg = <0>;
csiphy0_ep: endpoint {
- clock-lanes = <1>;
- data-lanes = <0 2>;
- remote-endpoint = <&ov5645_ep>;
- status = "disabled";
+ clock-lanes = <2>;
+ data-lanes = <0 1>;
+ remote-endpoint = <&ov5647_ep>;
};
};
port@1 {
diff --git a/arch/arm64/boot/dts/qcom/msm8916.dtsi b/arch/arm64/boot/dts/qcom/msm8916.dtsi
index 34d4b00e5c61..edb7d03aaec6 100644
--- a/arch/arm64/boot/dts/qcom/msm8916.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8916.dtsi
@@ -343,9 +343,23 @@
reg = <0x1000000 0x300000>;
interrupts = <GIC_SPI 208 IRQ_TYPE_LEVEL_HIGH>;
gpio-controller;
+ gpio-ranges = <&msmgpio 0 0 122>;
#gpio-cells = <2>;
interrupt-controller;
#interrupt-cells = <2>;
+
+ line_b {
+ gpio-hog;
+ gpios = <12 0>;
+ output-high;
+ line-name = "cam-pwr-gpio";
+ };
+ line_c {
+ gpio-hog;
+ gpios = <13 0>;
+ output-high;
+ line-name = "cam-led-gpio";
+ };
};
gcc: clock-controller@1800000 {
diff --git a/drivers/media/i2c/ov5647.c b/drivers/media/i2c/ov5647.c
index 95ce90fdb876..5720940d99b1 100644
--- a/drivers/media/i2c/ov5647.c
+++ b/drivers/media/i2c/ov5647.c
@@ -28,6 +28,7 @@
#include <linux/of_graph.h>
#include <linux/slab.h>
#include <linux/videodev2.h>
+#include <media/v4l2-ctrls.h>
#include <media/v4l2-device.h>
#include <media/v4l2-fwnode.h>
#include <media/v4l2-image-sizes.h>
@@ -77,6 +78,8 @@ struct ov5647 {
unsigned int height;
int power_count;
struct clk *xclk;
+ struct v4l2_ctrl_handler ctrls;
+ struct v4l2_ctrl *pixel_clock;
};
static inline struct ov5647 *to_state(struct v4l2_subdev *sd)
@@ -253,6 +256,7 @@ static int ov5647_stream_on(struct v4l2_subdev *sd)
{
int ret;
+ pr_info("Enabling OV5647 stream");
ret = ov5647_write(sd, 0x4202, 0x00);
if (ret < 0)
return ret;
@@ -526,6 +530,15 @@ static int ov5647_parse_dt(struct device_node *np)
return ret;
}
+static int ov5647_s_ctrl(struct v4l2_ctrl *ctrl)
+{
+ return 0;
+}
+
+static struct v4l2_ctrl_ops ov5647_ctrl_ops = {
+ .s_ctrl = ov5647_s_ctrl,
+};
+
static int ov5647_probe(struct i2c_client *client,
const struct i2c_device_id *id)
{
@@ -563,6 +576,12 @@ static int ov5647_probe(struct i2c_client *client,
mutex_init(&sensor->lock);
+ v4l2_ctrl_handler_init(&sensor->ctrls, 1);
+ sensor->pixel_clock = v4l2_ctrl_new_std(&sensor->ctrls,
+ &ov5647_ctrl_ops,
+ V4L2_CID_PIXEL_RATE,
+ 1, INT_MAX, 1, 46500000);
+ sensor->sd.ctrl_handler = &sensor->ctrls;
sd = &sensor->sd;
v4l2_i2c_subdev_init(sd, client, &ov5647_subdev_ops);
sensor->sd.internal_ops = &ov5647_subdev_internal_ops;
diff --git a/drivers/media/platform/qcom/camss/camss-vfe-4-1.c b/drivers/media/platform/qcom/camss/camss-vfe-4-1.c
index 174a36be6f5d..5a6861ec35bc 100644
--- a/drivers/media/platform/qcom/camss/camss-vfe-4-1.c
+++ b/drivers/media/platform/qcom/camss/camss-vfe-4-1.c
@@ -936,7 +936,7 @@ static irqreturn_t vfe_isr(int irq, void *dev)
vfe->ops->isr_read(vfe, &value0, &value1);
- trace_printk("VFE: status0 = 0x%08x, status1 = 0x%08x\n",
+ pr_info("VFE: status0 = 0x%08x, status1 = 0x%08x\n",
value0, value1);
if (value0 & VFE_0_IRQ_STATUS_0_RESET_ACK)
diff --git a/drivers/media/platform/qcom/camss/camss-vfe.c b/drivers/media/platform/qcom/camss/camss-vfe.c
index dc3412021a78..f4e40b3bb52d 100644
--- a/drivers/media/platform/qcom/camss/camss-vfe.c
+++ b/drivers/media/platform/qcom/camss/camss-vfe.c
@@ -1424,11 +1424,14 @@ static int vfe_set_stream(struct v4l2_subdev *sd, int enable)
int ret;
if (enable) {
+ pr_info("Enabling stream");
ret = vfe_enable(line);
if (ret < 0)
dev_err(vfe->camss->dev,
"Failed to enable vfe outputs\n");
+ pr_info("Enabled stream");
} else {
+ pr_info("Disabling stream");
ret = vfe_disable(line);
if (ret < 0)
dev_err(vfe->camss->dev,
diff --git a/drivers/pinctrl/qcom/pinctrl-msm.c b/drivers/pinctrl/qcom/pinctrl-msm.c
index 31632c087504..8f0368330a04 100644
--- a/drivers/pinctrl/qcom/pinctrl-msm.c
+++ b/drivers/pinctrl/qcom/pinctrl-msm.c
@@ -839,11 +839,24 @@ static int msm_gpio_init(struct msm_pinctrl *pctrl)
return ret;
}
- ret = gpiochip_add_pin_range(&pctrl->chip, dev_name(pctrl->dev), 0, 0, chip->ngpio);
- if (ret) {
- dev_err(pctrl->dev, "Failed to add pin range\n");
- gpiochip_remove(&pctrl->chip);
- return ret;
+ /*
+ * For DeviceTree-supported systems, the gpio core checks the
+ * pinctrl's device node for the "gpio-ranges" property.
+ * If it is present, it takes care of adding the pin ranges
+ * for the driver. In this case the driver can skip ahead.
+ *
+ * In order to remain compatible with older, existing DeviceTree
+ * files which don't set the "gpio-ranges" property or systems that
+ * utilize ACPI the driver has to call gpiochip_add_pin_range().
+ */
+ if (!of_property_read_bool(pctrl->dev->of_node, "gpio-ranges")) {
+ ret = gpiochip_add_pin_range(&pctrl->chip,
+ dev_name(pctrl->dev), 0, 0, chip->ngpio);
+ if (ret) {
+ dev_err(pctrl->dev, "Failed to add pin range\n");
+ gpiochip_remove(&pctrl->chip);
+ return ret;
+ }
}
ret = gpiochip_irqchip_add(chip,