Commit 65cd963e authored by Jani Nikula's avatar Jani Nikula

drm/i915/gmbus: pass gpio reg to intel_gpio_setup()

Avoid the additional gmbus lookup on the pin.
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220303181931.1661767-3-jani.nikula@intel.com
parent 39a8c428
...@@ -322,14 +322,13 @@ intel_gpio_post_xfer(struct i2c_adapter *adapter) ...@@ -322,14 +322,13 @@ intel_gpio_post_xfer(struct i2c_adapter *adapter)
} }
static void static void
intel_gpio_setup(struct intel_gmbus *bus, unsigned int pin) intel_gpio_setup(struct intel_gmbus *bus, i915_reg_t gpio_reg)
{ {
struct drm_i915_private *dev_priv = bus->dev_priv;
struct i2c_algo_bit_data *algo; struct i2c_algo_bit_data *algo;
algo = &bus->bit_algo; algo = &bus->bit_algo;
bus->gpio_reg = GPIO(get_gmbus_pin(dev_priv, pin)->gpio); bus->gpio_reg = gpio_reg;
bus->adapter.algo_data = algo; bus->adapter.algo_data = algo;
algo->setsda = set_data; algo->setsda = set_data;
algo->setscl = set_clock; algo->setscl = set_clock;
...@@ -909,7 +908,7 @@ int intel_gmbus_setup(struct drm_i915_private *dev_priv) ...@@ -909,7 +908,7 @@ int intel_gmbus_setup(struct drm_i915_private *dev_priv)
if (IS_I830(dev_priv)) if (IS_I830(dev_priv))
bus->force_bit = 1; bus->force_bit = 1;
intel_gpio_setup(bus, pin); intel_gpio_setup(bus, GPIO(gmbus_pin->gpio));
ret = i2c_add_adapter(&bus->adapter); ret = i2c_add_adapter(&bus->adapter);
if (ret) if (ret)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment