drm/i915: refer to pin instead of port in the intel_i2c.c interfaces
authorJani Nikula <jani.nikula@intel.com>
Thu, 26 Mar 2015 22:20:20 +0000 (00:20 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 1 Apr 2015 12:11:38 +0000 (14:11 +0200)
Rename intel_gmbus_is_port_valid to intel_gmbus_is_valid_pin, and rename
port parameters to pin as well. This matches usage all around, as
usually a pin is passed to the validity check function. No functional
changes.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/intel_bios.c
drivers/gpu/drm/i915/intel_dvo.c
drivers/gpu/drm/i915/intel_i2c.c
drivers/gpu/drm/i915/intel_lvds.c
drivers/gpu/drm/i915/intel_sdvo.c

index dca3a4d32a11e8376cdb704f5765d10a18c5eae1..b0390c8c9595070f70cb9d9827dc18d26225369a 100644 (file)
@@ -3065,13 +3065,13 @@ void i915_teardown_sysfs(struct drm_device *dev_priv);
 /* intel_i2c.c */
 extern int intel_setup_gmbus(struct drm_device *dev);
 extern void intel_teardown_gmbus(struct drm_device *dev);
-static inline bool intel_gmbus_is_port_valid(unsigned port)
+static inline bool intel_gmbus_is_valid_pin(unsigned int pin)
 {
-       return (port >= GMBUS_PIN_SSC && port <= GMBUS_PIN_DPD);
+       return (pin >= GMBUS_PIN_SSC && pin <= GMBUS_PIN_DPD);
 }
 
-extern struct i2c_adapter *intel_gmbus_get_adapter(
-               struct drm_i915_private *dev_priv, unsigned port);
+extern struct i2c_adapter *
+intel_gmbus_get_adapter(struct drm_i915_private *dev_priv, unsigned int pin);
 extern void intel_gmbus_set_speed(struct i2c_adapter *adapter, int speed);
 extern void intel_gmbus_force_bit(struct i2c_adapter *adapter, bool force_bit);
 static inline bool intel_gmbus_is_forced_bit(struct i2c_adapter *adapter)
index 40c8375a4477185536560f7d7ffd5945873c4583..333f4079343528d81ce34d06b774f6d0a6faadcc 100644 (file)
@@ -438,7 +438,7 @@ parse_general_definitions(struct drm_i915_private *dev_priv,
                if (block_size >= sizeof(*general)) {
                        int bus_pin = general->crt_ddc_gmbus_pin;
                        DRM_DEBUG_KMS("crt_ddc_bus_pin: %d\n", bus_pin);
-                       if (intel_gmbus_is_port_valid(bus_pin))
+                       if (intel_gmbus_is_valid_pin(bus_pin))
                                dev_priv->vbt.crt_ddc_pin = bus_pin;
                } else {
                        DRM_DEBUG_KMS("BDB_GD too small (%d). Invalid.\n",
index 447cdc76c960e712de95e2be1f12aad49d8f9ee6..bfedea3826d76322d308a3756cb9736123fcd3c1 100644 (file)
@@ -502,7 +502,7 @@ void intel_dvo_init(struct drm_device *dev)
                 * special cases, but otherwise default to what's defined
                 * in the spec.
                 */
-               if (intel_gmbus_is_port_valid(dvo->gpio))
+               if (intel_gmbus_is_valid_pin(dvo->gpio))
                        gpio = dvo->gpio;
                else if (dvo->type == INTEL_DVO_CHIP_LVDS)
                        gpio = GMBUS_PIN_SSC;
index b31088a551f20ffc376d5e65a14d257164ec1afe..b0003a2bd854b4d8520e3627a95862f203f684ff 100644 (file)
@@ -574,12 +574,12 @@ err:
 }
 
 struct i2c_adapter *intel_gmbus_get_adapter(struct drm_i915_private *dev_priv,
-                                           unsigned port)
+                                           unsigned int pin)
 {
-       WARN_ON(!intel_gmbus_is_port_valid(port));
+       WARN_ON(!intel_gmbus_is_valid_pin(pin));
        /* -1 to map pin pair to gmbus index */
-       return (intel_gmbus_is_port_valid(port)) ?
-               &dev_priv->gmbus[port - 1].adapter : NULL;
+       return (intel_gmbus_is_valid_pin(pin)) ?
+               &dev_priv->gmbus[pin - 1].adapter : NULL;
 }
 
 void intel_gmbus_set_speed(struct i2c_adapter *adapter, int speed)
index 87591615264569cbda087762c5d41a2754f8b23a..d61aa78ed7e3bc35b6b61ac1b3b0710d3be00ea4 100644 (file)
@@ -781,7 +781,7 @@ static bool lvds_is_present_in_vbt(struct drm_device *dev,
                    child->device_type != DEVICE_TYPE_LFP)
                        continue;
 
-               if (intel_gmbus_is_port_valid(child->i2c_pin))
+               if (intel_gmbus_is_valid_pin(child->i2c_pin))
                        *i2c_pin = child->i2c_pin;
 
                /* However, we cannot trust the BIOS writers to populate
index 3e0e9b0e350342a776d7994bea22169d9d33fca9..124992e48abd395f276c1ddc671efde67a7dc8cb 100644 (file)
@@ -2291,7 +2291,7 @@ intel_sdvo_select_i2c_bus(struct drm_i915_private *dev_priv,
        else
                mapping = &dev_priv->sdvo_mappings[1];
 
-       if (mapping->initialized && intel_gmbus_is_port_valid(mapping->i2c_pin))
+       if (mapping->initialized && intel_gmbus_is_valid_pin(mapping->i2c_pin))
                pin = mapping->i2c_pin;
        else
                pin = GMBUS_PIN_DPB;