Ignore:
Timestamp:
Apr 14, 2017, 9:41:36 PM (11 days ago)
Author:
brainslayer
Message:

kernel update

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/linux/universal/linux-4.9/drivers/gpu/drm/sun4i/sun4i_tcon.c

    r31574 r31859  
    2121#include <linux/ioport.h>
    2222#include <linux/of_address.h>
     23#include <linux/of_device.h>
    2324#include <linux/of_graph.h>
    2425#include <linux/of_irq.h>
     
    6364        }
    6465
    65         WARN_ON(!tcon->has_channel_1);
     66        WARN_ON(!tcon->quirks->has_channel_1);
    6667        regmap_update_bits(tcon->regs, SUN4I_TCON1_CTL_REG,
    6768                           SUN4I_TCON1_CTL_TCON_ENABLE, 0);
     
    8182        }
    8283
    83         WARN_ON(!tcon->has_channel_1);
     84        WARN_ON(!tcon->quirks->has_channel_1);
    8485        regmap_update_bits(tcon->regs, SUN4I_TCON1_CTL_REG,
    8586                           SUN4I_TCON1_CTL_TCON_ENABLE,
     
    203204        u32 val;
    204205
    205         WARN_ON(!tcon->has_channel_1);
     206        WARN_ON(!tcon->quirks->has_channel_1);
    206207
    207208        /* Adjust clock delay */
     
    267268         * FIXME: Undocumented bits
    268269         */
    269         if (tcon->has_mux)
     270        if (tcon->quirks->has_unknown_mux)
    270271                regmap_write(tcon->regs, SUN4I_TCON_MUX_CTRL_REG, 1);
    271272}
     
    328329        }
    329330
    330         if (tcon->has_channel_1) {
     331        if (tcon->quirks->has_channel_1) {
    331332                tcon->sclk1 = devm_clk_get(dev, "tcon-ch1");
    332333                if (IS_ERR(tcon->sclk1)) {
     
    488489        tcon->drm = drm;
    489490        tcon->dev = dev;
    490 
    491         if (of_device_is_compatible(dev->of_node, "allwinner,sun5i-a13-tcon")) {
    492                 tcon->has_mux = true;
    493                 tcon->has_channel_1 = true;
    494         } else {
    495                 tcon->has_mux = false;
    496                 tcon->has_channel_1 = false;
    497         }
     491        tcon->quirks = of_device_get_match_data(dev);
    498492
    499493        tcon->lcd_rst = devm_reset_control_get(dev, "lcd");
     
    589583}
    590584
     585static const struct sun4i_tcon_quirks sun5i_a13_quirks = {
     586        .has_unknown_mux = true,
     587        .has_channel_1  = true,
     588};
     589
     590static const struct sun4i_tcon_quirks sun6i_a31_quirks = {
     591        .has_channel_1  = true,
     592};
     593
     594static const struct sun4i_tcon_quirks sun6i_a31s_quirks = {
     595        .has_channel_1  = true,
     596};
     597
     598static const struct sun4i_tcon_quirks sun8i_a33_quirks = {
     599        /* nothing is supported */
     600};
     601
    591602static const struct of_device_id sun4i_tcon_of_table[] = {
    592         { .compatible = "allwinner,sun5i-a13-tcon" },
    593         { .compatible = "allwinner,sun8i-a33-tcon" },
     603        { .compatible = "allwinner,sun5i-a13-tcon", .data = &sun5i_a13_quirks },
     604        { .compatible = "allwinner,sun6i-a31-tcon", .data = &sun6i_a31_quirks },
     605        { .compatible = "allwinner,sun6i-a31s-tcon", .data = &sun6i_a31s_quirks },
     606        { .compatible = "allwinner,sun8i-a33-tcon", .data = &sun8i_a33_quirks },
    594607        { }
    595608};
Note: See TracChangeset for help on using the changeset viewer.