hc
2024-05-10 9999e48639b3cecb08ffb37358bcba3b48161b29
kernel/drivers/media/i2c/s5k5baf.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Driver for Samsung S5K5BAF UXGA 1/5" 2M CMOS Image Sensor
34 * with embedded SoC ISP.
....@@ -7,10 +8,6 @@
78 *
89 * Based on S5K6AA driver authored by Sylwester Nawrocki
910 * Copyright (C) 2013, Samsung Electronics Co., Ltd.
10
- *
11
- * This program is free software; you can redistribute it and/or modify
12
- * it under the terms of the GNU General Public License version 2 as
13
- * published by the Free Software Foundation.
1411 */
1512
1613 #include <linux/clk.h>
....@@ -283,8 +280,7 @@
283280 struct {
284281 u16 id;
285282 u16 offset;
286
- } seq[0];
287
- u16 data[0];
283
+ } seq[];
288284 };
289285
290286 struct s5k5baf {
....@@ -566,7 +562,7 @@
566562 if (fw == NULL)
567563 return NULL;
568564
569
- data = fw->data + 2 * fw->count;
565
+ data = &fw->seq[0].id + 2 * fw->count;
570566
571567 for (i = 0; i < fw->count; ++i) {
572568 if (fw->seq[i].id == seq_id)
....@@ -766,7 +762,7 @@
766762 {
767763 u16 en_pkts;
768764
769
- if (state->bus_type == V4L2_MBUS_CSI2)
765
+ if (state->bus_type == V4L2_MBUS_CSI2_DPHY)
770766 en_pkts = EN_PACKETS_CSI2;
771767 else
772768 en_pkts = 0;
....@@ -1841,7 +1837,7 @@
18411837 {
18421838 struct device_node *node = dev->of_node;
18431839 struct device_node *node_ep;
1844
- struct v4l2_fwnode_endpoint ep;
1840
+ struct v4l2_fwnode_endpoint ep = { .bus_type = 0 };
18451841 int ret;
18461842
18471843 if (!node) {
....@@ -1875,7 +1871,7 @@
18751871 state->bus_type = ep.bus_type;
18761872
18771873 switch (state->bus_type) {
1878
- case V4L2_MBUS_CSI2:
1874
+ case V4L2_MBUS_CSI2_DPHY:
18791875 state->nlanes = ep.bus.mipi_csi2.num_data_lanes;
18801876 break;
18811877 case V4L2_MBUS_PARALLEL:
....@@ -1949,8 +1945,7 @@
19491945 return ret;
19501946 }
19511947
1952
-static int s5k5baf_probe(struct i2c_client *c,
1953
- const struct i2c_device_id *id)
1948
+static int s5k5baf_probe(struct i2c_client *c)
19541949 {
19551950 struct s5k5baf *state;
19561951 int ret;
....@@ -2049,7 +2044,7 @@
20492044 .of_match_table = s5k5baf_of_match,
20502045 .name = S5K5BAF_DRIVER_NAME
20512046 },
2052
- .probe = s5k5baf_probe,
2047
+ .probe_new = s5k5baf_probe,
20532048 .remove = s5k5baf_remove,
20542049 .id_table = s5k5baf_id,
20552050 };