.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * Samsung LSI S5C73M3 8M pixel camera driver |
---|
3 | 4 | * |
---|
4 | 5 | * Copyright (C) 2012, Samsung Electronics, Co., Ltd. |
---|
5 | 6 | * Sylwester Nawrocki <s.nawrocki@samsung.com> |
---|
6 | 7 | * Andrzej Hajda <a.hajda@samsung.com> |
---|
7 | | - * |
---|
8 | | - * This program is free software; you can redistribute it and/or |
---|
9 | | - * modify it under the terms of the GNU General Public License |
---|
10 | | - * version 2 as published by the Free Software Foundation. |
---|
11 | | - * |
---|
12 | | - * This program is distributed in the hope that it will be useful, |
---|
13 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
14 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
15 | | - * GNU General Public License for more details. |
---|
16 | 8 | */ |
---|
17 | 9 | |
---|
18 | 10 | #include <linux/clk.h> |
---|
.. | .. |
---|
1431 | 1423 | for (++i; i < S5C73M3_MAX_SUPPLIES; i++) { |
---|
1432 | 1424 | int r = regulator_enable(state->supplies[i].consumer); |
---|
1433 | 1425 | if (r < 0) |
---|
1434 | | - v4l2_err(&state->oif_sd, "Failed to reenable %s: %d\n", |
---|
| 1426 | + v4l2_err(&state->oif_sd, "Failed to re-enable %s: %d\n", |
---|
1435 | 1427 | state->supplies[i].supply, r); |
---|
1436 | 1428 | } |
---|
1437 | 1429 | |
---|
.. | .. |
---|
1603 | 1595 | const struct s5c73m3_platform_data *pdata = dev->platform_data; |
---|
1604 | 1596 | struct device_node *node = dev->of_node; |
---|
1605 | 1597 | struct device_node *node_ep; |
---|
1606 | | - struct v4l2_fwnode_endpoint ep; |
---|
| 1598 | + struct v4l2_fwnode_endpoint ep = { .bus_type = 0 }; |
---|
1607 | 1599 | int ret; |
---|
1608 | 1600 | |
---|
1609 | 1601 | if (!node) { |
---|
.. | .. |
---|
1644 | 1636 | if (ret) |
---|
1645 | 1637 | return ret; |
---|
1646 | 1638 | |
---|
1647 | | - if (ep.bus_type != V4L2_MBUS_CSI2) { |
---|
| 1639 | + if (ep.bus_type != V4L2_MBUS_CSI2_DPHY) { |
---|
1648 | 1640 | dev_err(dev, "unsupported bus type\n"); |
---|
1649 | 1641 | return -EINVAL; |
---|
1650 | 1642 | } |
---|
.. | .. |
---|
1658 | 1650 | return 0; |
---|
1659 | 1651 | } |
---|
1660 | 1652 | |
---|
1661 | | -static int s5c73m3_probe(struct i2c_client *client, |
---|
1662 | | - const struct i2c_device_id *id) |
---|
| 1653 | +static int s5c73m3_probe(struct i2c_client *client) |
---|
1663 | 1654 | { |
---|
1664 | 1655 | struct device *dev = &client->dev; |
---|
1665 | 1656 | struct v4l2_subdev *sd; |
---|
.. | .. |
---|
1683 | 1674 | v4l2_subdev_init(sd, &s5c73m3_subdev_ops); |
---|
1684 | 1675 | sd->owner = client->dev.driver->owner; |
---|
1685 | 1676 | v4l2_set_subdevdata(sd, state); |
---|
1686 | | - strlcpy(sd->name, "S5C73M3", sizeof(sd->name)); |
---|
| 1677 | + strscpy(sd->name, "S5C73M3", sizeof(sd->name)); |
---|
1687 | 1678 | |
---|
1688 | 1679 | sd->internal_ops = &s5c73m3_internal_ops; |
---|
1689 | 1680 | sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; |
---|
.. | .. |
---|
1698 | 1689 | return ret; |
---|
1699 | 1690 | |
---|
1700 | 1691 | v4l2_i2c_subdev_init(oif_sd, client, &oif_subdev_ops); |
---|
1701 | | - strcpy(oif_sd->name, "S5C73M3-OIF"); |
---|
| 1692 | + /* Static name; NEVER use in new drivers! */ |
---|
| 1693 | + strscpy(oif_sd->name, "S5C73M3-OIF", sizeof(oif_sd->name)); |
---|
1702 | 1694 | |
---|
1703 | 1695 | oif_sd->internal_ops = &oif_internal_ops; |
---|
1704 | 1696 | oif_sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; |
---|
.. | .. |
---|
1813 | 1805 | .of_match_table = of_match_ptr(s5c73m3_of_match), |
---|
1814 | 1806 | .name = DRIVER_NAME, |
---|
1815 | 1807 | }, |
---|
1816 | | - .probe = s5c73m3_probe, |
---|
| 1808 | + .probe_new = s5c73m3_probe, |
---|
1817 | 1809 | .remove = s5c73m3_remove, |
---|
1818 | 1810 | .id_table = s5c73m3_id, |
---|
1819 | 1811 | }; |
---|