From 05cacb176712cbbd3ae0331d92fe57741ef2d2ba Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Thu, 30 Jan 2014 16:32:21 -0300 Subject: [media] adv7604: Store I2C addresses and clients in arrays This allows replacing duplicate code blocks by loops over the arrays. Signed-off-by: Laurent Pinchart Reviewed-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- include/media/adv7604.h | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) (limited to 'include/media') diff --git a/include/media/adv7604.h b/include/media/adv7604.h index d8b2cb8..276135b 100644 --- a/include/media/adv7604.h +++ b/include/media/adv7604.h @@ -79,6 +79,23 @@ enum adv7604_int1_config { ADV7604_INT1_CONFIG_DISABLED, }; +enum adv7604_page { + ADV7604_PAGE_IO, + ADV7604_PAGE_AVLINK, + ADV7604_PAGE_CEC, + ADV7604_PAGE_INFOFRAME, + ADV7604_PAGE_ESDP, + ADV7604_PAGE_DPP, + ADV7604_PAGE_AFE, + ADV7604_PAGE_REP, + ADV7604_PAGE_EDID, + ADV7604_PAGE_HDMI, + ADV7604_PAGE_TEST, + ADV7604_PAGE_CP, + ADV7604_PAGE_VDP, + ADV7604_PAGE_MAX, +}; + /* Platform dependent definition */ struct adv7604_platform_data { /* DIS_PWRDNB: 1 if the PWRDNB pin is unused and unconnected */ @@ -125,18 +142,7 @@ struct adv7604_platform_data { unsigned hdmi_free_run_mode; /* i2c addresses: 0 == use default */ - u8 i2c_avlink; - u8 i2c_cec; - u8 i2c_infoframe; - u8 i2c_esdp; - u8 i2c_dpp; - u8 i2c_afe; - u8 i2c_repeater; - u8 i2c_edid; - u8 i2c_hdmi; - u8 i2c_test; - u8 i2c_cp; - u8 i2c_vdp; + u8 i2c_addresses[ADV7604_PAGE_MAX]; }; enum adv7604_pad { -- cgit v1.1