drm/i915/gmbus: switch to intel_de_* register accessors in display code
Avoid direct uncore use in display code. Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Signed-off-by: Jani Nikula <jani.nikula@intel.com> Reviewed-by: Andrzej Hajda <andrzej.hajda@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/05690286d1521ec9c82d680122cca9a90a75b8dd.1670433372.git.jani.nikula@intel.com
This commit is contained in:
parent
ec2593e307
commit
01f84f7421
@ -255,14 +255,12 @@ static void bxt_gmbus_clock_gating(struct drm_i915_private *i915,
|
||||
static u32 get_reserved(struct intel_gmbus *bus)
|
||||
{
|
||||
struct drm_i915_private *i915 = bus->i915;
|
||||
struct intel_uncore *uncore = &i915->uncore;
|
||||
u32 reserved = 0;
|
||||
|
||||
/* On most chips, these bits must be preserved in software. */
|
||||
if (!IS_I830(i915) && !IS_I845G(i915))
|
||||
reserved = intel_uncore_read_notrace(uncore, bus->gpio_reg) &
|
||||
(GPIO_DATA_PULLUP_DISABLE |
|
||||
GPIO_CLOCK_PULLUP_DISABLE);
|
||||
reserved = intel_de_read_notrace(i915, bus->gpio_reg) &
|
||||
(GPIO_DATA_PULLUP_DISABLE | GPIO_CLOCK_PULLUP_DISABLE);
|
||||
|
||||
return reserved;
|
||||
}
|
||||
@ -270,37 +268,31 @@ static u32 get_reserved(struct intel_gmbus *bus)
|
||||
static int get_clock(void *data)
|
||||
{
|
||||
struct intel_gmbus *bus = data;
|
||||
struct intel_uncore *uncore = &bus->i915->uncore;
|
||||
struct drm_i915_private *i915 = bus->i915;
|
||||
u32 reserved = get_reserved(bus);
|
||||
|
||||
intel_uncore_write_notrace(uncore,
|
||||
bus->gpio_reg,
|
||||
reserved | GPIO_CLOCK_DIR_MASK);
|
||||
intel_uncore_write_notrace(uncore, bus->gpio_reg, reserved);
|
||||
intel_de_write_notrace(i915, bus->gpio_reg, reserved | GPIO_CLOCK_DIR_MASK);
|
||||
intel_de_write_notrace(i915, bus->gpio_reg, reserved);
|
||||
|
||||
return (intel_uncore_read_notrace(uncore, bus->gpio_reg) &
|
||||
GPIO_CLOCK_VAL_IN) != 0;
|
||||
return (intel_de_read_notrace(i915, bus->gpio_reg) & GPIO_CLOCK_VAL_IN) != 0;
|
||||
}
|
||||
|
||||
static int get_data(void *data)
|
||||
{
|
||||
struct intel_gmbus *bus = data;
|
||||
struct intel_uncore *uncore = &bus->i915->uncore;
|
||||
struct drm_i915_private *i915 = bus->i915;
|
||||
u32 reserved = get_reserved(bus);
|
||||
|
||||
intel_uncore_write_notrace(uncore,
|
||||
bus->gpio_reg,
|
||||
reserved | GPIO_DATA_DIR_MASK);
|
||||
intel_uncore_write_notrace(uncore, bus->gpio_reg, reserved);
|
||||
intel_de_write_notrace(i915, bus->gpio_reg, reserved | GPIO_DATA_DIR_MASK);
|
||||
intel_de_write_notrace(i915, bus->gpio_reg, reserved);
|
||||
|
||||
return (intel_uncore_read_notrace(uncore, bus->gpio_reg) &
|
||||
GPIO_DATA_VAL_IN) != 0;
|
||||
return (intel_de_read_notrace(i915, bus->gpio_reg) & GPIO_DATA_VAL_IN) != 0;
|
||||
}
|
||||
|
||||
static void set_clock(void *data, int state_high)
|
||||
{
|
||||
struct intel_gmbus *bus = data;
|
||||
struct intel_uncore *uncore = &bus->i915->uncore;
|
||||
struct drm_i915_private *i915 = bus->i915;
|
||||
u32 reserved = get_reserved(bus);
|
||||
u32 clock_bits;
|
||||
|
||||
@ -310,16 +302,14 @@ static void set_clock(void *data, int state_high)
|
||||
clock_bits = GPIO_CLOCK_DIR_OUT | GPIO_CLOCK_DIR_MASK |
|
||||
GPIO_CLOCK_VAL_MASK;
|
||||
|
||||
intel_uncore_write_notrace(uncore,
|
||||
bus->gpio_reg,
|
||||
reserved | clock_bits);
|
||||
intel_uncore_posting_read(uncore, bus->gpio_reg);
|
||||
intel_de_write_notrace(i915, bus->gpio_reg, reserved | clock_bits);
|
||||
intel_de_posting_read(i915, bus->gpio_reg);
|
||||
}
|
||||
|
||||
static void set_data(void *data, int state_high)
|
||||
{
|
||||
struct intel_gmbus *bus = data;
|
||||
struct intel_uncore *uncore = &bus->i915->uncore;
|
||||
struct drm_i915_private *i915 = bus->i915;
|
||||
u32 reserved = get_reserved(bus);
|
||||
u32 data_bits;
|
||||
|
||||
@ -329,8 +319,8 @@ static void set_data(void *data, int state_high)
|
||||
data_bits = GPIO_DATA_DIR_OUT | GPIO_DATA_DIR_MASK |
|
||||
GPIO_DATA_VAL_MASK;
|
||||
|
||||
intel_uncore_write_notrace(uncore, bus->gpio_reg, reserved | data_bits);
|
||||
intel_uncore_posting_read(uncore, bus->gpio_reg);
|
||||
intel_de_write_notrace(i915, bus->gpio_reg, reserved | data_bits);
|
||||
intel_de_posting_read(i915, bus->gpio_reg);
|
||||
}
|
||||
|
||||
static int
|
||||
@ -439,9 +429,7 @@ gmbus_wait_idle(struct drm_i915_private *i915)
|
||||
add_wait_queue(&i915->display.gmbus.wait_queue, &wait);
|
||||
intel_de_write_fw(i915, GMBUS4(i915), irq_enable);
|
||||
|
||||
ret = intel_wait_for_register_fw(&i915->uncore,
|
||||
GMBUS2(i915), GMBUS_ACTIVE, 0,
|
||||
10);
|
||||
ret = intel_de_wait_for_register_fw(i915, GMBUS2(i915), GMBUS_ACTIVE, 0, 10);
|
||||
|
||||
intel_de_write_fw(i915, GMBUS4(i915), 0);
|
||||
remove_wait_queue(&i915->display.gmbus.wait_queue, &wait);
|
||||
|
Loading…
x
Reference in New Issue
Block a user