aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLespiau, Damien <damien.lespiau@intel.com>2013-08-19 11:59:02 -0400
committerDave Airlie <airlied@gmail.com>2013-08-29 18:41:42 -0400
commitae84b900b009589a7017a1f8f060edd7de501642 (patch)
tree2e7aba702d9c2c95510f271fa9c8b1fa751810ea
parentaf3e95b40720cdf301eb85387c0a3dc4067cc551 (diff)
video/hdmi: Use hdmi_vendor_infoframe for the HDMI specific infoframe
We just got rid of the version of hdmi_vendor_infoframe that had a byte array for anyone to poke at. It's now time to shuffle around the naming of hdmi_hdmi_infoframe to make hdmi_vendor_infoframe become the HDMI vendor specific structure. Cc: Thierry Reding <thierry.reding@gmail.com> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com> Reviewed-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Dave Airlie <airlied@gmail.com>
-rw-r--r--drivers/gpu/host1x/drm/hdmi.c6
-rw-r--r--drivers/video/hdmi.c25
-rw-r--r--include/linux/hdmi.h15
3 files changed, 24 insertions, 22 deletions
diff --git a/drivers/gpu/host1x/drm/hdmi.c b/drivers/gpu/host1x/drm/hdmi.c
index b5489187a163..52e3c9641a0f 100644
--- a/drivers/gpu/host1x/drm/hdmi.c
+++ b/drivers/gpu/host1x/drm/hdmi.c
@@ -539,7 +539,7 @@ static void tegra_hdmi_setup_audio_infoframe(struct tegra_hdmi *hdmi)
539 539
540static void tegra_hdmi_setup_stereo_infoframe(struct tegra_hdmi *hdmi) 540static void tegra_hdmi_setup_stereo_infoframe(struct tegra_hdmi *hdmi)
541{ 541{
542 struct hdmi_hdmi_infoframe frame; 542 struct hdmi_vendor_infoframe frame;
543 unsigned long value; 543 unsigned long value;
544 u8 buffer[10]; 544 u8 buffer[10];
545 ssize_t err; 545 ssize_t err;
@@ -551,10 +551,10 @@ static void tegra_hdmi_setup_stereo_infoframe(struct tegra_hdmi *hdmi)
551 return; 551 return;
552 } 552 }
553 553
554 hdmi_hdmi_infoframe_init(&frame); 554 hdmi_vendor_infoframe_init(&frame);
555 frame.s3d_struct = HDMI_3D_STRUCTURE_FRAME_PACKING; 555 frame.s3d_struct = HDMI_3D_STRUCTURE_FRAME_PACKING;
556 556
557 err = hdmi_hdmi_infoframe_pack(&frame, buffer, sizeof(buffer)); 557 err = hdmi_vendor_infoframe_pack(&frame, buffer, sizeof(buffer));
558 if (err < 0) { 558 if (err < 0) {
559 dev_err(hdmi->dev, "failed to pack vendor infoframe: %zd\n", 559 dev_err(hdmi->dev, "failed to pack vendor infoframe: %zd\n",
560 err); 560 err);
diff --git a/drivers/video/hdmi.c b/drivers/video/hdmi.c
index fbccb88c2620..4f73167c8647 100644
--- a/drivers/video/hdmi.c
+++ b/drivers/video/hdmi.c
@@ -288,12 +288,12 @@ ssize_t hdmi_audio_infoframe_pack(struct hdmi_audio_infoframe *frame,
288EXPORT_SYMBOL(hdmi_audio_infoframe_pack); 288EXPORT_SYMBOL(hdmi_audio_infoframe_pack);
289 289
290/** 290/**
291 * hdmi_hdmi_infoframe_init() - initialize an HDMI vendor infoframe 291 * hdmi_vendor_infoframe_init() - initialize an HDMI vendor infoframe
292 * @frame: HDMI vendor infoframe 292 * @frame: HDMI vendor infoframe
293 * 293 *
294 * Returns 0 on success or a negative error code on failure. 294 * Returns 0 on success or a negative error code on failure.
295 */ 295 */
296int hdmi_hdmi_infoframe_init(struct hdmi_hdmi_infoframe *frame) 296int hdmi_vendor_infoframe_init(struct hdmi_vendor_infoframe *frame)
297{ 297{
298 memset(frame, 0, sizeof(*frame)); 298 memset(frame, 0, sizeof(*frame));
299 299
@@ -310,10 +310,10 @@ int hdmi_hdmi_infoframe_init(struct hdmi_hdmi_infoframe *frame)
310 310
311 return 0; 311 return 0;
312} 312}
313EXPORT_SYMBOL(hdmi_hdmi_infoframe_init); 313EXPORT_SYMBOL(hdmi_vendor_infoframe_init);
314 314
315/** 315/**
316 * hdmi_hdmi_infoframe_pack() - write a HDMI vendor infoframe to binary buffer 316 * hdmi_vendor_infoframe_pack() - write a HDMI vendor infoframe to binary buffer
317 * @frame: HDMI infoframe 317 * @frame: HDMI infoframe
318 * @buffer: destination buffer 318 * @buffer: destination buffer
319 * @size: size of buffer 319 * @size: size of buffer
@@ -326,7 +326,7 @@ EXPORT_SYMBOL(hdmi_hdmi_infoframe_init);
326 * Returns the number of bytes packed into the binary buffer or a negative 326 * Returns the number of bytes packed into the binary buffer or a negative
327 * error code on failure. 327 * error code on failure.
328 */ 328 */
329ssize_t hdmi_hdmi_infoframe_pack(struct hdmi_hdmi_infoframe *frame, 329ssize_t hdmi_vendor_infoframe_pack(struct hdmi_vendor_infoframe *frame,
330 void *buffer, size_t size) 330 void *buffer, size_t size)
331{ 331{
332 u8 *ptr = buffer; 332 u8 *ptr = buffer;
@@ -377,19 +377,20 @@ ssize_t hdmi_hdmi_infoframe_pack(struct hdmi_hdmi_infoframe *frame,
377 377
378 return length; 378 return length;
379} 379}
380EXPORT_SYMBOL(hdmi_hdmi_infoframe_pack); 380EXPORT_SYMBOL(hdmi_vendor_infoframe_pack);
381 381
382/* 382/*
383 * hdmi_vendor_infoframe_pack() - write a vendor infoframe to binary buffer 383 * hdmi_vendor_any_infoframe_pack() - write a vendor infoframe to binary buffer
384 */ 384 */
385static ssize_t hdmi_vendor_infoframe_pack(union hdmi_vendor_infoframe *frame, 385static ssize_t
386 void *buffer, size_t size) 386hdmi_vendor_any_infoframe_pack(union hdmi_vendor_any_infoframe *frame,
387 void *buffer, size_t size)
387{ 388{
388 /* we only know about HDMI vendor infoframes */ 389 /* we only know about HDMI vendor infoframes */
389 if (frame->any.oui != HDMI_IDENTIFIER) 390 if (frame->any.oui != HDMI_IDENTIFIER)
390 return -EINVAL; 391 return -EINVAL;
391 392
392 return hdmi_hdmi_infoframe_pack(&frame->hdmi, buffer, size); 393 return hdmi_vendor_infoframe_pack(&frame->hdmi, buffer, size);
393} 394}
394 395
395/** 396/**
@@ -422,8 +423,8 @@ hdmi_infoframe_pack(union hdmi_infoframe *frame, void *buffer, size_t size)
422 length = hdmi_audio_infoframe_pack(&frame->audio, buffer, size); 423 length = hdmi_audio_infoframe_pack(&frame->audio, buffer, size);
423 break; 424 break;
424 case HDMI_INFOFRAME_TYPE_VENDOR: 425 case HDMI_INFOFRAME_TYPE_VENDOR:
425 length = hdmi_vendor_infoframe_pack(&frame->vendor, 426 length = hdmi_vendor_any_infoframe_pack(&frame->vendor,
426 buffer, size); 427 buffer, size);
427 break; 428 break;
428 default: 429 default:
429 WARN(1, "Bad infoframe type %d\n", frame->any.type); 430 WARN(1, "Bad infoframe type %d\n", frame->any.type);
diff --git a/include/linux/hdmi.h b/include/linux/hdmi.h
index e24d850a8ee6..d4ae12c7931b 100644
--- a/include/linux/hdmi.h
+++ b/include/linux/hdmi.h
@@ -237,7 +237,8 @@ enum hdmi_3d_structure {
237 HDMI_3D_STRUCTURE_SIDE_BY_SIDE_HALF = 8, 237 HDMI_3D_STRUCTURE_SIDE_BY_SIDE_HALF = 8,
238}; 238};
239 239
240struct hdmi_hdmi_infoframe { 240
241struct hdmi_vendor_infoframe {
241 enum hdmi_infoframe_type type; 242 enum hdmi_infoframe_type type;
242 unsigned char version; 243 unsigned char version;
243 unsigned char length; 244 unsigned char length;
@@ -247,25 +248,25 @@ struct hdmi_hdmi_infoframe {
247 unsigned int s3d_ext_data; 248 unsigned int s3d_ext_data;
248}; 249};
249 250
250int hdmi_hdmi_infoframe_init(struct hdmi_hdmi_infoframe *frame); 251int hdmi_vendor_infoframe_init(struct hdmi_vendor_infoframe *frame);
251ssize_t hdmi_hdmi_infoframe_pack(struct hdmi_hdmi_infoframe *frame, 252ssize_t hdmi_vendor_infoframe_pack(struct hdmi_vendor_infoframe *frame,
252 void *buffer, size_t size); 253 void *buffer, size_t size);
253 254
254union hdmi_vendor_infoframe { 255union hdmi_vendor_any_infoframe {
255 struct { 256 struct {
256 enum hdmi_infoframe_type type; 257 enum hdmi_infoframe_type type;
257 unsigned char version; 258 unsigned char version;
258 unsigned char length; 259 unsigned char length;
259 unsigned int oui; 260 unsigned int oui;
260 } any; 261 } any;
261 struct hdmi_hdmi_infoframe hdmi; 262 struct hdmi_vendor_infoframe hdmi;
262}; 263};
263 264
264union hdmi_infoframe { 265union hdmi_infoframe {
265 struct hdmi_any_infoframe any; 266 struct hdmi_any_infoframe any;
266 struct hdmi_avi_infoframe avi; 267 struct hdmi_avi_infoframe avi;
267 struct hdmi_spd_infoframe spd; 268 struct hdmi_spd_infoframe spd;
268 union hdmi_vendor_infoframe vendor; 269 union hdmi_vendor_any_infoframe vendor;
269 struct hdmi_audio_infoframe audio; 270 struct hdmi_audio_infoframe audio;
270}; 271};
271 272