Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bdfe91f4 authored by Joe Perches's avatar Joe Perches Committed by Mauro Carvalho Chehab
Browse files

[media] m5602: Use current logging styles



Add pr_fmt and convert usb style logging macro uses to pr_<level>.
Coalesce format strings.

Signed-off-by: default avatarJoe Perches <joe@perches.com>
Acked-by: default avatarErik Andrén <erik.andren@gmail.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent d650fc30
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@
 *
 */

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include "m5602_ov9650.h"
#include "m5602_ov7660.h"
#include "m5602_mt9m111.h"
@@ -192,10 +194,9 @@ static void m5602_dump_bridge(struct sd *sd)
	for (i = 0; i < 0x80; i++) {
		unsigned char val = 0;
		m5602_read_bridge(sd, i, &val);
		info("ALi m5602 address 0x%x contains 0x%x", i, val);
		pr_info("ALi m5602 address 0x%x contains 0x%x\n", i, val);
	}
	info("Warning: The ALi m5602 webcam probably won't work "
		"until it's power cycled");
	pr_info("Warning: The ALi m5602 webcam probably won't work until it's power cycled\n");
}

static int m5602_probe_sensor(struct sd *sd)
@@ -231,7 +232,7 @@ static int m5602_probe_sensor(struct sd *sd)
		return 0;

	/* More sensor probe function goes here */
	info("Failed to find a sensor");
	pr_info("Failed to find a sensor\n");
	sd->sensor = NULL;
	return -ENODEV;
}
+15 −13
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@
 *
 */

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include "m5602_mt9m111.h"

static int mt9m111_set_vflip(struct gspca_dev *gspca_dev, __s32 val);
@@ -163,7 +165,7 @@ int mt9m111_probe(struct sd *sd)

	if (force_sensor) {
		if (force_sensor == MT9M111_SENSOR) {
			info("Forcing a %s sensor", mt9m111.name);
			pr_info("Forcing a %s sensor\n", mt9m111.name);
			goto sensor_found;
		}
		/* If we want to force another sensor, don't try to probe this
@@ -191,7 +193,7 @@ int mt9m111_probe(struct sd *sd)
		return -ENODEV;

	if ((data[0] == 0x14) && (data[1] == 0x3a)) {
		info("Detected a mt9m111 sensor");
		pr_info("Detected a mt9m111 sensor\n");
		goto sensor_found;
	}

@@ -612,34 +614,34 @@ static void mt9m111_dump_registers(struct sd *sd)
{
	u8 address, value[2] = {0x00, 0x00};

	info("Dumping the mt9m111 register state");
	pr_info("Dumping the mt9m111 register state\n");

	info("Dumping the mt9m111 sensor core registers");
	pr_info("Dumping the mt9m111 sensor core registers\n");
	value[1] = MT9M111_SENSOR_CORE;
	m5602_write_sensor(sd, MT9M111_PAGE_MAP, value, 2);
	for (address = 0; address < 0xff; address++) {
		m5602_read_sensor(sd, address, value, 2);
		info("register 0x%x contains 0x%x%x",
		pr_info("register 0x%x contains 0x%x%x\n",
			address, value[0], value[1]);
	}

	info("Dumping the mt9m111 color pipeline registers");
	pr_info("Dumping the mt9m111 color pipeline registers\n");
	value[1] = MT9M111_COLORPIPE;
	m5602_write_sensor(sd, MT9M111_PAGE_MAP, value, 2);
	for (address = 0; address < 0xff; address++) {
		m5602_read_sensor(sd, address, value, 2);
		info("register 0x%x contains 0x%x%x",
		pr_info("register 0x%x contains 0x%x%x\n",
			address, value[0], value[1]);
	}

	info("Dumping the mt9m111 camera control registers");
	pr_info("Dumping the mt9m111 camera control registers\n");
	value[1] = MT9M111_CAMERA_CONTROL;
	m5602_write_sensor(sd, MT9M111_PAGE_MAP, value, 2);
	for (address = 0; address < 0xff; address++) {
		m5602_read_sensor(sd, address, value, 2);
		info("register 0x%x contains 0x%x%x",
		pr_info("register 0x%x contains 0x%x%x\n",
			address, value[0], value[1]);
	}

	info("mt9m111 register state dump complete");
	pr_info("mt9m111 register state dump complete\n");
}
+11 −10
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@
 *
 */

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include "m5602_ov7660.h"

static int ov7660_get_gain(struct gspca_dev *gspca_dev, __s32 *val);
@@ -149,7 +151,7 @@ int ov7660_probe(struct sd *sd)

	if (force_sensor) {
		if (force_sensor == OV7660_SENSOR) {
			info("Forcing an %s sensor", ov7660.name);
			pr_info("Forcing an %s sensor\n", ov7660.name);
			goto sensor_found;
		}
		/* If we want to force another sensor,
@@ -180,10 +182,10 @@ int ov7660_probe(struct sd *sd)
	if (m5602_read_sensor(sd, OV7660_VER, &ver_id, 1))
		return -ENODEV;

	info("Sensor reported 0x%x%x", prod_id, ver_id);
	pr_info("Sensor reported 0x%x%x\n", prod_id, ver_id);

	if ((prod_id == 0x76) && (ver_id == 0x60)) {
		info("Detected a ov7660 sensor");
		pr_info("Detected a ov7660 sensor\n");
		goto sensor_found;
	}
	return -ENODEV;
@@ -457,17 +459,16 @@ static int ov7660_set_vflip(struct gspca_dev *gspca_dev, __s32 val)
static void ov7660_dump_registers(struct sd *sd)
{
	int address;
	info("Dumping the ov7660 register state");
	pr_info("Dumping the ov7660 register state\n");
	for (address = 0; address < 0xa9; address++) {
		u8 value;
		m5602_read_sensor(sd, address, &value, 1);
		info("register 0x%x contains 0x%x",
		     address, value);
		pr_info("register 0x%x contains 0x%x\n", address, value);
	}

	info("ov7660 register state dump complete");
	pr_info("ov7660 register state dump complete\n");

	info("Probing for which registers that are read/write");
	pr_info("Probing for which registers that are read/write\n");
	for (address = 0; address < 0xff; address++) {
		u8 old_value, ctrl_value;
		u8 test_value[2] = {0xff, 0xff};
@@ -477,9 +478,9 @@ static void ov7660_dump_registers(struct sd *sd)
		m5602_read_sensor(sd, address, &ctrl_value, 1);

		if (ctrl_value == test_value[0])
			info("register 0x%x is writeable", address);
			pr_info("register 0x%x is writeable\n", address);
		else
			info("register 0x%x is read only", address);
			pr_info("register 0x%x is read only\n", address);

		/* Restore original value */
		m5602_write_sensor(sd, address, &old_value, 1);
+10 −9
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@
 *
 */

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include "m5602_ov9650.h"

static int ov9650_set_exposure(struct gspca_dev *gspca_dev, __s32 val);
@@ -299,7 +301,7 @@ int ov9650_probe(struct sd *sd)

	if (force_sensor) {
		if (force_sensor == OV9650_SENSOR) {
			info("Forcing an %s sensor", ov9650.name);
			pr_info("Forcing an %s sensor\n", ov9650.name);
			goto sensor_found;
		}
		/* If we want to force another sensor,
@@ -330,7 +332,7 @@ int ov9650_probe(struct sd *sd)
		return -ENODEV;

	if ((prod_id == 0x96) && (ver_id == 0x52)) {
		info("Detected an ov9650 sensor");
		pr_info("Detected an ov9650 sensor\n");
		goto sensor_found;
	}
	return -ENODEV;
@@ -850,17 +852,16 @@ static int ov9650_set_auto_gain(struct gspca_dev *gspca_dev, __s32 val)
static void ov9650_dump_registers(struct sd *sd)
{
	int address;
	info("Dumping the ov9650 register state");
	pr_info("Dumping the ov9650 register state\n");
	for (address = 0; address < 0xa9; address++) {
		u8 value;
		m5602_read_sensor(sd, address, &value, 1);
		info("register 0x%x contains 0x%x",
		     address, value);
		pr_info("register 0x%x contains 0x%x\n", address, value);
	}

	info("ov9650 register state dump complete");
	pr_info("ov9650 register state dump complete\n");

	info("Probing for which registers that are read/write");
	pr_info("Probing for which registers that are read/write\n");
	for (address = 0; address < 0xff; address++) {
		u8 old_value, ctrl_value;
		u8 test_value[2] = {0xff, 0xff};
@@ -870,9 +871,9 @@ static void ov9650_dump_registers(struct sd *sd)
		m5602_read_sensor(sd, address, &ctrl_value, 1);

		if (ctrl_value == test_value[0])
			info("register 0x%x is writeable", address);
			pr_info("register 0x%x is writeable\n", address);
		else
			info("register 0x%x is read only", address);
			pr_info("register 0x%x is read only\n", address);

		/* Restore original value */
		m5602_write_sensor(sd, address, &old_value, 1);
+11 −10
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@
 *
 */

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include "m5602_po1030.h"

static int po1030_get_exposure(struct gspca_dev *gspca_dev, __s32 *val);
@@ -197,7 +199,7 @@ int po1030_probe(struct sd *sd)

	if (force_sensor) {
		if (force_sensor == PO1030_SENSOR) {
			info("Forcing a %s sensor", po1030.name);
			pr_info("Forcing a %s sensor\n", po1030.name);
			goto sensor_found;
		}
		/* If we want to force another sensor, don't try to probe this
@@ -221,7 +223,7 @@ int po1030_probe(struct sd *sd)
		return -ENODEV;

	if (dev_id_h == 0x30) {
		info("Detected a po1030 sensor");
		pr_info("Detected a po1030 sensor\n");
		goto sensor_found;
	}
	return -ENODEV;
@@ -267,7 +269,7 @@ int po1030_init(struct sd *sd)
			break;

		default:
			info("Invalid stream command, exiting init");
			pr_info("Invalid stream command, exiting init\n");
			return -EINVAL;
		}
	}
@@ -733,16 +735,15 @@ static void po1030_dump_registers(struct sd *sd)
	int address;
	u8 value = 0;

	info("Dumping the po1030 sensor core registers");
	pr_info("Dumping the po1030 sensor core registers\n");
	for (address = 0; address < 0x7f; address++) {
		m5602_read_sensor(sd, address, &value, 1);
		info("register 0x%x contains 0x%x",
		     address, value);
		pr_info("register 0x%x contains 0x%x\n", address, value);
	}

	info("po1030 register state dump complete");
	pr_info("po1030 register state dump complete\n");

	info("Probing for which registers that are read/write");
	pr_info("Probing for which registers that are read/write\n");
	for (address = 0; address < 0xff; address++) {
		u8 old_value, ctrl_value;
		u8 test_value[2] = {0xff, 0xff};
@@ -752,9 +753,9 @@ static void po1030_dump_registers(struct sd *sd)
		m5602_read_sensor(sd, address, &ctrl_value, 1);

		if (ctrl_value == test_value[0])
			info("register 0x%x is writeable", address);
			pr_info("register 0x%x is writeable\n", address);
		else
			info("register 0x%x is read only", address);
			pr_info("register 0x%x is read only\n", address);

		/* Restore original value */
		m5602_write_sensor(sd, address, &old_value, 1);
Loading