Commit 1c9b943c authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab
Browse files

media: si2168: use bits instead of bool for flags



Using bool on struct is not recommended, as it wastes lots of
space. So, instead, let's use bits.

While here, convert the comments to kernel-doc format.

Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
parent 219031a6
Loading
Loading
Loading
Loading
+26 −21
Original line number Diff line number Diff line
@@ -9,38 +9,43 @@
#define SI2168_H

#include <linux/dvb/frontend.h>
/*
 * I2C address
 * 0x64
/**
 * struct si2168_config - configuration parameters for si2168
 *
 * @fe:
 *	frontend returned by driver
 * @i2c_adapter:
 *	tuner I2C adapter returned by driver
 * @ts_mode:
 *	Transport Stream mode. Can be:
 *	- %SI2168_TS_PARALLEL
 *	- %SI2168_TS_SERIAL
 *	- %SI2168_TS_TRISTATE
 *	- %SI2168_TS_CLK_MANUAL
 * @ts_clock_inv:
 *	TS clock inverted
 * @ts_clock_gapped:
 *	TS clock gapped
 * @spectral_inversion:
 *	Inverted spectrum
 *
 * Note:
 *	The I2C address of this demod is 0x64.
 */
struct si2168_config {
	/*
	 * frontend
	 * returned by driver
	 */
	struct dvb_frontend **fe;

	/*
	 * tuner I2C adapter
	 * returned by driver
	 */
	struct i2c_adapter **i2c_adapter;

	/* TS mode */
#define SI2168_TS_PARALLEL	0x06
#define SI2168_TS_SERIAL	0x03
#define SI2168_TS_TRISTATE	0x00
#define SI2168_TS_CLK_MANUAL	0x20
	u8 ts_mode;

	/* TS clock inverted */
	bool ts_clock_inv;

	/* TS clock gapped */
	bool ts_clock_gapped;

	/* Inverted spectrum */
	bool spectral_inversion;
	/* Flags */
	unsigned int ts_clock_inv:1;
	unsigned int ts_clock_gapped:1;
	unsigned int spectral_inversion:1;
};

#endif
+5 −5
Original line number Diff line number Diff line
@@ -34,12 +34,12 @@ struct si2168_dev {
	unsigned int chip_id;
	unsigned int version;
	const char *firmware_name;
	bool active;
	bool warm;
	u8 ts_mode;
	bool ts_clock_inv;
	bool ts_clock_gapped;
	bool spectral_inversion;
	unsigned int active:1;
	unsigned int warm:1;
	unsigned int ts_clock_inv:1;
	unsigned int ts_clock_gapped:1;
	unsigned int spectral_inversion:1;
};

/* firmware command struct */