~ubuntu-branches/ubuntu/wily/linux-ti-omap4/wily

« back to all changes in this revision

Viewing changes to ubuntu/i915/dvo_ns2501.c

  • Committer: Package Import Robot
  • Author(s): Paolo Pisati, Paolo Pisati, Ubuntu: 3.5.0-20.31
  • Date: 2012-12-06 14:14:29 UTC
  • Revision ID: package-import@ubuntu.com-20121206141429-3f6mmypbjdmnmm2t
Tags: 3.5.0-216.23
* Release Tracking Bug
  - LP: #1087216

[ Paolo Pisati ]

* rebased on Ubuntu-3.5.0-20.31

[ Ubuntu: 3.5.0-20.31 ]

* Release Tracking Bug
  - LP: #1086759
* SAUCE: i915_hsw: Include #define I915_PARAM_HAS_WAIT_TIMEOUT
  - LP: #1085245
* SAUCE: i915_hsw: Include #define DRM_I915_GEM_CONTEXT_[CREATE,DESTROY]
  - LP: #1085245
* SAUCE: i915_hsw: drm/i915: add register read IOCTL
  - LP: #1085245
* SAUCE: i915_hsw: Include #define i915_execbuffer2_[set,get]_context_id
  - LP: #1085245
* SAUCE: i915_hsw: Include #define I915_GEM_PARAM_HAS_SEMAPHORES
  - LP: #1085245
* SAUCE: i915_hsw: Include #define I915_PARAM_HAS_SECURE_BATCHES
  - LP: #1085245
* SAUCE: i915_hsw: drm/i915: call intel_enable_gtt
  - LP: #1085245
* SAUCE: i915_hsw: drm: add helper to sort panels to the head of the
  connector list
  - LP: #1085245
* SAUCE: i915_hsw: drm: extract dp link bw helpers
  - LP: #1085245
* SAUCE: i915_hsw: drm: extract drm_dp_max_lane_count helper
  - LP: #1085245
* SAUCE: i915_hsw: drm: dp helper: extract drm_dp_channel_eq_ok
  - LP: #1085245
* SAUCE: i915_hsw: drm: extract helpers to compute new training values
  from sink request
  - LP: #1085245
* SAUCE: i915_hsw: drm: dp helper: extract drm_dp_clock_recovery_ok
  - LP: #1085245
* SAUCE: i915_hsw: Include #define I915_PARAM_HAS_PRIME_VMAP_FLUSH
  - LP: #1085245
* SAUCE: i915_hsw: Provide an ubuntu/i915 driver for Haswell graphics
  - LP: #1085245
* SAUCE: i915_hsw: Revert "drm: Make the .mode_fixup() operations mode
  argument a const pointer" for ubuntu/i915 driver
  - LP: #1085245
* SAUCE: i915_hsw: Rename ubuntu/i915 driver i915_hsw
  - LP: #1085245
* SAUCE: i915_hsw: Only support Haswell with ubuntu/i915 driver
  - LP: #1085245
* SAUCE: i915_hsw: Include #define DRM_I915_GEM_WAIT
  - LP: #1085245
* SAUCE: i915_hsw: drm: extract dp link train delay functions from radeon
  - LP: #1085245
* SAUCE: i915_hsw: drm/dp: Update DPCD defines
  - LP: #1085245
* SAUCE: i915_hsw: Update intel_ips.h file location
  - LP: #1085245
* SAUCE: i915_hsw: Provide updated drm_mm.h and drm_mm.c for ubuntu/i915
  - LP: #1085245
* SAUCE: i915_hsw: drm/i915: Replace the array of pages with a
  scatterlist
  - LP: #1085245
* SAUCE: i915_hsw: drm/i915: Replace the array of pages with a
  scatterlist
  - LP: #1085245
* SAUCE: i915_hsw: drm/i915: Stop using AGP layer for GEN6+
  - LP: #1085245
* SAUCE: i915_hsw: Add i915_hsw_gpu_*() calls for ubuntu/i915
  - LP: #1085245
* i915_hsw: [Config] Enable CONFIG_DRM_I915_HSW=m
  - LP: #1085245
* SAUCE: drm/i915: fix hsw_fdi_link_train "retry" code
  - LP: #1085245
* SAUCE: drm/i915: reject modes the LPT FDI receiver can't handle
  - LP: #1085245
* SAUCE: drm/i915: add support for mPHY destination on intel_sbi_{read,
  write}
  - LP: #1085245
* SAUCE: drm/i915: add lpt_init_pch_refclk
  - LP: #1085245
* SAUCE: drm/i915: set the LPT FDI RX polarity reversal bit when needed
  - LP: #1085245
* Revert "SAUCE: SECCOMP: audit: always report seccomp violations"
  - LP: #1079469
* Revert "cgroup: Drop task_lock(parent) on cgroup_fork()"
  - LP: #1084539
* Revert "cgroup: Remove task_lock() from cgroup_post_fork()"
  - LP: #1084539
* Revert "x86/mm: Fix the size calculation of mapping tables"
  - LP: #1084539
* Revert "SUNRPC: Ensure we close the socket on EPIPE errors too..."
  - LP: #1084539
* Revert "ath9k_hw: Updated AR9003 tx gain table for 5GHz"
  - LP: #1084539
* Revert "sched: Add missing call to calc_load_exit_idle()"
  - LP: #1084539
* net: fix secpath kmemleak
  - LP: #1065434
* seccomp: forcing auditing of kill condition
  - LP: #1079469
* e1000e: add device IDs for i218
  - LP: #1081796
* bonding: Bonding driver does not consider the gso_max_size/gso_max_segs
  setting of slave devices.
  - LP: #1078184
* mm/hotplug: correctly add new zone to all other nodes' zone lists
  - LP: #1079860
  - CVE-2012-5517
* xen: enable platform-pci only in a Xen guest
  - LP: #1081054
* udf: fix retun value on error path in udf_load_logicalvol
  - LP: #1084539
* usb: gadget: at91_udc: fix dt support
  - LP: #1084539
* netfilter: nf_nat_sip: fix incorrect handling of EBUSY for RTCP
  expectation
  - LP: #1084539
* netfilter: nf_nat_sip: fix via header translation with multiple
  parameters
  - LP: #1084539
* netfilter: nf_ct_expect: fix possible access to uninitialized timer
  - LP: #1084539
* netfilter: xt_limit: have r->cost != 0 case work
  - LP: #1084539
* netfilter: nf_conntrack: fix racy timer handling with reliable events
  - LP: #1084539
* netfilter: nfnetlink_log: fix NLA_PUT macro removal bug
  - LP: #1084539
* MIPS: ath79: Fix CPU/DDR frequency calculation for SRIF PLLs
  - LP: #1084539
* jbd: Fix assertion failure in commit code due to lacking transaction
  credits
  - LP: #1084539
* nfsd4: fix nfs4 stateid leak
  - LP: #1084539
* NFSD: pass null terminated buf to kstrtouint()
  - LP: #1084539
* mfd: 88pm860x: Move _IO resources out of ioport_ioresource
  - LP: #1084539
* target: support zero allocation length in INQUIRY
  - LP: #1084539
* target: fix truncation of mode data, support zero allocation length
  - LP: #1084539
* target: fix return code in target_core_init_configfs error path
  - LP: #1084539
* powerpc/eeh: Lock module while handling EEH event
  - LP: #1084539
* SUNRPC: Ensure that the TCP socket is closed when in CLOSE_WAIT
  - LP: #1084539
* ext4: remove erroneous ext4_superblock_csum_set() in update_backups()
  - LP: #1084539
* block: remove the duplicated setting for congestion_threshold
  - LP: #1084539
* block: lift the initial queue bypass mode on blk_register_queue()
  instead of blk_init_allocated_queue()
  - LP: #1084539
* block: fix request_queue->flags initialization
  - LP: #1084539
* viafb: don't touch clock state on OLPC XO-1.5
  - LP: #1084539
* qla2xxx: Fix endianness of task management response code
  - LP: #1084539
* iscsi-target: Correctly set 0xffffffff field within ISCSI_OP_REJECT PDU
  - LP: #1084539
* drm/i915: use adjusted_mode instead of mode for checking the 6bpc force
  flag
  - LP: #1084539
* kbuild: Do not package /boot and /lib in make tar-pkg
  - LP: #1084539
* module: taint kernel when lve module is loaded
  - LP: #1084539
* mtd: nand: allow NAND_NO_SUBPAGE_WRITE to be set from driver
  - LP: #1084539
* nfsd4: don't pin clientids to pseudoflavors
  - LP: #1084539
* lockd: use rpc client's cl_nodename for id encoding
  - LP: #1084539
* pnfsblock: fix partial page buffer wirte
  - LP: #1084539
* pnfsblock: fix non-aligned DIO read
  - LP: #1084539
* pnfsblock: fix non-aligned DIO write
  - LP: #1084539
* target/file: Re-enable optional fd_buffered_io=1 operation
  - LP: #1084539
* iscsi-target: Add explicit set of cache_dynamic_acls=1 for TPG
  demo-mode
  - LP: #1084539
* iscsit: remove incorrect unlock in iscsit_build_sendtargets_resp
  - LP: #1084539
* iscsi-target: Bump defaults for nopin_timeout + nopin_response_timeout
  values
  - LP: #1084539
* drivers/dma/dmaengine.c: lower the priority of 'failed to get' dma
  channel message
  - LP: #1084539
* ath9k: use ieee80211_free_txskb
  - LP: #1084539
* ALSA: hda - Fix hang caused by race during suspend.
  - LP: #1084539
* ACPI: EC: Make the GPE storm threshold a module parameter
  - LP: #1084539
* ACPI: EC: Add a quirk for CLEVO M720T/M730T laptop
  - LP: #1084539
* mmc: sdhci-s3c: fix the wrong number of max bus clocks
  - LP: #1084539
* mac80211: use ieee80211_free_txskb to fix possible skb leaks
  - LP: #1084539
* ARM: OMAP: counter: add locking to read_persistent_clock
  - LP: #1084539
* ARM: vfp: fix saving d16-d31 vfp registers on v6+ kernels
  - LP: #1084539
* scsi_debug: Fix off-by-one bug when unmapping region
  - LP: #1084539
* storvsc: Account for in-transit packets in the RESET path
  - LP: #1084539
* firewire: cdev: fix user memory corruption (i386 userland on amd64
  kernel)
  - LP: #1084539
* timers: Fix endless looping between cascade() and internal_add_timer()
  - LP: #1084539
* timekeeping: Cast raw_interval to u64 to avoid shift overflow
  - LP: #1084539
* video/udlfb: fix line counting in fb_write
  - LP: #1084539
* tmpfs,ceph,gfs2,isofs,reiserfs,xfs: fix fh_len checking
  - LP: #1084539
* ALSA: hda - Add missing hda_gen_spec to struct via_spec
  - LP: #1084539
* ALSA: hda - Fix memory leaks at error path in patch_cirrus.c
  - LP: #1084539
* autofs4 - fix reset pending flag on mount fail
  - LP: #1084539
* pktgen: fix crash when generating IPv6 packets
  - LP: #1084539
* md/raid10: use correct limit variable
  - LP: #1084539
* mips,kgdb: fix recursive page fault with CONFIG_KPROBES
  - LP: #1084539
* kdb,vt_console: Fix missed data due to pager overruns
  - LP: #1084539
* xen/bootup: allow read_tscp call for Xen PV guests.
  - LP: #1084539
* xen/bootup: allow {read|write}_cr8 pvops call.
  - LP: #1084539
* libceph: eliminate connection state "DEAD"
  - LP: #1084539
* libceph: kill bad_proto ceph connection op
  - LP: #1084539
* libceph: rename socket callbacks
  - LP: #1084539
* libceph: rename kvec_reset and kvec_add functions
  - LP: #1084539
* libceph: embed ceph messenger structure in ceph_client
  - LP: #1084539
* libceph: start separating connection flags from state
  - LP: #1084539
* libceph: start tracking connection socket state
  - LP: #1084539
* libceph: provide osd number when creating osd
  - LP: #1084539
* libceph: set CLOSED state bit in con_init
  - LP: #1084539
* libceph: embed ceph connection structure in mon_client
  - LP: #1084539
* libceph: drop connection refcounting for mon_client
  - LP: #1084539
* libceph: init monitor connection when opening
  - LP: #1084539
* libceph: fully initialize connection in con_init()
  - LP: #1084539
* libceph: tweak ceph_alloc_msg()
  - LP: #1084539
* libceph: have messages point to their connection
  - LP: #1084539
* libceph: have messages take a connection reference
  - LP: #1084539
* libceph: make ceph_con_revoke() a msg operation
  - LP: #1084539
* libceph: make ceph_con_revoke_message() a msg op
  - LP: #1084539
* libceph: fix overflow in __decode_pool_names()
  - LP: #1084539
* libceph: fix overflow in osdmap_decode()
  - LP: #1084539
* libceph: fix overflow in osdmap_apply_incremental()
  - LP: #1084539
* libceph: transition socket state prior to actual connect
  - LP: #1084539
* libceph: fix NULL dereference in reset_connection()
  - LP: #1084539
* libceph: use con get/put methods
  - LP: #1084539
* libceph: drop ceph_con_get/put helpers and nref member
  - LP: #1084539
* libceph: encapsulate out message data setup
  - LP: #1084539
* libceph: encapsulate advancing msg page
  - LP: #1084539
* libceph: don't mark footer complete before it is
  - LP: #1084539
* libceph: move init_bio_*() functions up
  - LP: #1084539
* libceph: move init of bio_iter
  - LP: #1084539
* libceph: don't use bio_iter as a flag
  - LP: #1084539
* libceph: SOCK_CLOSED is a flag, not a state
  - LP: #1084539
* libceph: don't change socket state on sock event
  - LP: #1084539
* libceph: just set SOCK_CLOSED when state changes
  - LP: #1084539
* libceph: don't touch con state in con_close_socket()
  - LP: #1084539
* libceph: clear CONNECTING in ceph_con_close()
  - LP: #1084539
* libceph: clear NEGOTIATING when done
  - LP: #1084539
* libceph: define and use an explicit CONNECTED state
  - LP: #1084539
* libceph: separate banner and connect writes
  - LP: #1084539
* libceph: distinguish two phases of connect sequence
  - LP: #1084539
* libceph: small changes to messenger.c
  - LP: #1084539
* libceph: add some fine ASCII art
  - LP: #1084539
* libceph: set peer name on con_open, not init
  - LP: #1084539
* libceph: initialize mon_client con only once
  - LP: #1084539
* libceph: allow sock transition from CONNECTING to CLOSED
  - LP: #1084539
* libceph: initialize msgpool message types
  - LP: #1084539
* libceph: prevent the race of incoming work during teardown
  - LP: #1084539
* libceph: report socket read/write error message
  - LP: #1084539
* libceph: fix mutex coverage for ceph_con_close
  - LP: #1084539
* libceph: resubmit linger ops when pg mapping changes
  - LP: #1084539
* libceph: (re)initialize bio_iter on start of message receive
  - LP: #1084539
* libceph: protect ceph_con_open() with mutex
  - LP: #1084539
* libceph: reset connection retry on successfully negotiation
  - LP: #1084539
* libceph: fix fault locking; close socket on lossy fault
  - LP: #1084539
* libceph: move msgr clear_standby under con mutex protection
  - LP: #1084539
* libceph: move ceph_con_send() closed check under the con mutex
  - LP: #1084539
* libceph: drop gratuitous socket close calls in con_work
  - LP: #1084539
* libceph: close socket directly from ceph_con_close()
  - LP: #1084539
* libceph: drop unnecessary CLOSED check in socket state change callback
  - LP: #1084539
* libceph: replace connection state bits with states
  - LP: #1084539
* libceph: clean up con flags
  - LP: #1084539
* libceph: clear all flags on con_close
  - LP: #1084539
* libceph: fix handling of immediate socket connect failure
  - LP: #1084539
* libceph: revoke mon_client messages on session restart
  - LP: #1084539
* libceph: verify state after retaking con lock after dispatch
  - LP: #1084539
* libceph: avoid dropping con mutex before fault
  - LP: #1084539
* libceph: change ceph_con_in_msg_alloc convention to be less weird
  - LP: #1084539
* libceph: recheck con state after allocating incoming message
  - LP: #1084539
* libceph: fix crypto key null deref, memory leak
  - LP: #1084539
* libceph: delay debugfs initialization until we learn global_id
  - LP: #1084539
* libceph: avoid truncation due to racing banners
  - LP: #1084539
* libceph: only kunmap kmapped pages
  - LP: #1084539
* rbd: reset BACKOFF if unable to re-queue
  - LP: #1084539
* libceph: avoid NULL kref_put when osd reset races with alloc_msg
  - LP: #1084539
* ceph: fix dentry reference leak in encode_fh()
  - LP: #1084539
* ceph: Fix oops when handling mdsmap that decreases max_mds
  - LP: #1084539
* libceph: check for invalid mapping
  - LP: #1084539
* ceph: avoid 32-bit page index overflow
  - LP: #1084539
* ASoC: wm2200: Use rev A register patches on rev B
  - LP: #1084539
* ASoC: wm2200: Fix non-inverted OUT2 mute control
  - LP: #1084539
* drm/i915: remove useless BUG_ON which caused a regression in 3.5.
  - LP: #1084539
* USB: Enable LPM after a failed probe.
  - LP: #1084539
* usb: Don't enable LPM if the exit latency is zero.
  - LP: #1084539
* usb: Send Set SEL before enabling parent U1/U2 timeout.
  - LP: #1084539
* ASoC: fsi: don't reschedule DMA from an atomic context
  - LP: #1084539
* drm/i915: Set guardband clipping workaround bit in the right register.
  - LP: #1084539
* pcmcia: sharpsl: don't discard sharpsl_pcmcia_ops
  - LP: #1084539
* hwmon: (coretemp) Add support for Atom CE4110/4150/4170
  - LP: #1084539
* ALSA: hda - Fix registration race of VGA switcheroo
  - LP: #1084539
* usb: dwc3: gadget: fix 'endpoint always busy' bug
  - LP: #1084539
* usb: musb: am35xx: drop spurious unplugging a device
  - LP: #1084539
* drm/radeon: Don't destroy I2C Bus Rec in radeon_ext_tmds_enc_destroy().
  - LP: #1084539
* ALSA: hda - Always check array bounds in alc_get_line_out_pfx
  - LP: #1084539
* NLM: nlm_lookup_file() may return NLMv4-specific error codes
  - LP: #1084539
* x86: Exclude E820_RESERVED regions and memory holes above 4 GB from
  direct mapping.
  - LP: #1084539
* SUNRPC: Prevent kernel stack corruption on long values of flush
  - LP: #1084539
* USB: cdc-acm: fix pipe type of write endpoint
  - LP: #1084539
* usb: acm: fix the computation of the number of data bits
  - LP: #1084539
* usb: host: xhci: New system added for Compliance Mode Patch on
  SN65LVPE502CP
  - LP: #1084539
* USB: option: blacklist net interface on ZTE devices
  - LP: #1084539
* USB: option: add more ZTE devices
  - LP: #1084539
* ext4: race-condition protection for
  ext4_convert_unwritten_extents_endio
  - LP: #1084539
* ext4: fix metadata checksum calculation for the superblock
  - LP: #1084539
* nohz: Fix idle ticks in cpu summary line of /proc/stat
  - LP: #1084539
* ring-buffer: Check for uninitialized cpu buffer before resizing
  - LP: #1084539
* Bluetooth: SMP: Fix setting unknown auth_req bits
  - LP: #1084539
* oprofile, x86: Fix wrapping bug in op_x86_get_ctrl()
  - LP: #1084539
* cfg80211/mac80211: avoid state mishmash on deauth
  - LP: #1084539
* mac80211: check if key has TKIP type before updating IV
  - LP: #1084539
* mac80211: use ieee80211_free_txskb in a few more places
  - LP: #1084539
* bcma: fix unregistration of cores
  - LP: #1084539
* net/wireless: ipw2200: Fix panic occurring in
  ipw_handle_promiscuous_tx()
  - LP: #1084539
* iwlwifi: fix 6000 series channel switch command
  - LP: #1084539
* cgroup: notify_on_release may not be triggered in some cases
  - LP: #1084539
* dt: Document: correct tegra20/30 pinctrl slew-rate name
  - LP: #1084539
* pinctrl: tegra: set low power mode bank width to 2
  - LP: #1084539
* pinctrl: tegra: correct bank for pingroup and drv pingroup
  - LP: #1084539
* s390: fix linker script for 31 bit builds
  - LP: #1084539
* pinctrl: remove mutex lock in groups show
  - LP: #1084539
* xen/x86: don't corrupt %eip when returning from a signal handler
  - LP: #1084539
* ALSA: hda - Fix silent headphone output from Toshiba P200
  - LP: #1084539
* ext4: Checksum the block bitmap properly with bigalloc enabled
  - LP: #1084539
* ARM: 7559/1: smp: switch away from the idmap before updating
  init_mm.mm_count
  - LP: #1084539
* usb hub: send clear_tt_buffer_complete events when canceling TT clear
  work
  - LP: #1084539
* staging: comedi: amplc_pc236: fix invalid register access during detach
  - LP: #1084539
* Staging: android: binder: Fix memory leak on thread/process exit
  - LP: #1084539
* Staging: android: binder: Allow using highmem for binder buffers
  - LP: #1084539
* ext4: Avoid underflow in ext4_trim_fs()
  - LP: #1084539
* cpufreq / powernow-k8: Remove usage of smp_processor_id() in
  preemptible code
  - LP: #1084539
* extcon: Unregister compat class at module unload to fix oops
  - LP: #1084539
* extcon: unregister compat link on cleanup
  - LP: #1084539
* pinctrl: fix missing unlock on error in pinctrl_groups_show()
  - LP: #1084539
* arch/tile: avoid generating .eh_frame information in modules
  - LP: #1084539
* drm/radeon: add some new SI PCI ids
  - LP: #1084539
* drm/radeon: add error output if VM CS fails on cayman
  - LP: #1084539
* xhci: endianness xhci_calculate_intel_u2_timeout
  - LP: #1084539
* xhci: fix integer overflow
  - LP: #1084539
* dmaengine: imx-dma: fix missing unlock on error in imxdma_xfer_desc()
  - LP: #1084539
* x86-64: Fix page table accounting
  - LP: #1084539
* dmaengine: sirf: fix a typo in dma_prep_interleaved
  - LP: #1084539
* dmaengine: sirf: fix a typo in moving running dma_desc to active queue
  - LP: #1084539
* amd64_edac:__amd64_set_scrub_rate(): avoid overindexing scrubrates[]
  - LP: #1084539
* SUNRPC: Clear the connect flag when socket state is TCP_CLOSE_WAIT
  - LP: #1084539
* SUNRPC: Prevent races in xs_abort_connection()
  - LP: #1084539
* SUNRPC: Get rid of the xs_error_report socket callback
  - LP: #1084539
* iommu/tegra: smmu: Fix deadly typo
  - LP: #1084539
* ARM: at91/tc: fix typo in the DT document
  - LP: #1084539
* ARM: at91: at91sam9g10: fix SOC type detection
  - LP: #1084539
* ARM: at91/i2c: change id to let i2c-gpio work
  - LP: #1084539
* b43: Fix oops on unload when firmware not found
  - LP: #1084539
* USB: serial: Fix memory leak in sierra_release()
  - LP: #1084539
* x86, mm: Trim memory in memblock to be page aligned
  - LP: #1084539
* x86, mm: Use memblock memory loop instead of e820_RAM
  - LP: #1084539
* usb-storage: add unusual_devs entry for Casio EX-N1 digital camera
  - LP: #1084539
* Drivers: hv: Cleanup error handling in vmbus_open()
  - LP: #1084539
* sysfs: sysfs_pathname/sysfs_add_one: Use strlcat() instead of strcat()
  - LP: #1084539
* vhost: fix mergeable bufs on BE hosts
  - LP: #1084539
* USB: metro-usb: fix io after disconnect
  - LP: #1084539
* USB: whiteheat: fix memory leak in error path
  - LP: #1084539
* USB: quatech2: fix memory leak in error path
  - LP: #1084539
* USB: quatech2: fix io after disconnect
  - LP: #1084539
* USB: opticon: fix DMA from stack
  - LP: #1084539
* USB: opticon: fix memory leak in error path
  - LP: #1084539
* USB: mct_u232: fix broken close
  - LP: #1084539
* USB: sierra: fix memory leak in attach error path
  - LP: #1084539
* USB: sierra: fix memory leak in probe error path
  - LP: #1084539
* USB: mos7840: fix urb leak at release
  - LP: #1084539
* USB: mos7840: fix port-device leak in error path
  - LP: #1084539
* USB: mos7840: remove NULL-urb submission
  - LP: #1084539
* USB: mos7840: remove invalid disconnect handling
  - LP: #1084539
* ehci: fix Lucid nohandoff pci quirk to be more generic with BIOS
  versions
  - LP: #1084539
* ehci: Add yet-another Lucid nohandoff pci quirk
  - LP: #1084539
* xhci: Fix potential NULL ptr deref in command cancellation.
  - LP: #1084539
* freezer: exec should clear PF_NOFREEZE along with PF_KTHREAD
  - LP: #1084539
* mm: fix XFS oops due to dirty pages without buffers on s390
  - LP: #1084539
* genalloc: stop crashing the system when destroying a pool
  - LP: #1084539
* drivers/rtc/rtc-imxdi.c: add missing spin lock initialization
  - LP: #1084539
* gen_init_cpio: avoid stack overflow when expanding
  - LP: #1084539
* fs/compat_ioctl.c: VIDEO_SET_SPU_PALETTE missing error check
  - LP: #1084539
* qmi_wwan/cdc_ether: move Novatel 551 and E362 to qmi_wwan
  - LP: #1084539
* efi: Defer freeing boot services memory until after ACPI init
  - LP: #1084539
* x86: efi: Turn off efi_enabled after setup on mixed fw/kernel
  - LP: #1082059, #1084539
* target: Re-add explict zeroing of INQUIRY bounce buffer memory
  - LP: #1084539
* ARM: 7566/1: vfp: fix save and restore when running on pre-VFPv3 and
  CONFIG_VFPv3 set
  - LP: #1084539
* libceph: drop declaration of ceph_con_get()
  - LP: #1084539
* x86, mm: Find_early_table_space based on ranges that are actually being
  mapped
  - LP: #1084539
* x86, mm: Undo incorrect revert in arch/x86/mm/init.c
  - LP: #1084539
* Linux 3.5.7.1
  - LP: #1084539
* ALSA: hda - Cirrus: Correctly clear line_out_pins when moving to
  speaker
  - LP: #1076840
* Bluetooth: ath3k: Add support for VAIO VPCEH [0489:e027]
  - LP: #898826
* i915_hsw: drm/i915: Reserve ioctl numbers for set/get_caching
  - LP: #1085245
* i915_hsw: drm: Export drm_probe_ddc()
  - LP: #1085245
* i915_hsw: drm: remove the raw_edid field from struct drm_display_info
  - LP: #1085245
* i915_hsw: drm/i915: fix hsw uncached pte
  - LP: #1085245
* i915_hsw: drm/fb-helper: delay hotplug handling when partially bound
  - LP: #1085245
* i915_hsw: drm/fb helper: don't call drm_crtc_helper_set_config
  - LP: #1085245
* i915_hsw: drm/fb-helper: don't clobber output routing in setup_crtcs
  - LP: #1085245
* i915_hsw: drm/fb helper: don't call drm_helper_connector_dpms directly
  - LP: #1085245
* i915_hsw: drm/edid: Fix potential memory leak in edid_load()
  - LP: #1085245

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *
 
3
 * Copyright (c) 2012 Gilles Dartiguelongue, Thomas Richter
 
4
 *
 
5
 * All Rights Reserved.
 
6
 *
 
7
 * Permission is hereby granted, free of charge, to any person obtaining a
 
8
 * copy of this software and associated documentation files (the
 
9
 * "Software"), to deal in the Software without restriction, including
 
10
 * without limitation the rights to use, copy, modify, merge, publish,
 
11
 * distribute, sub license, and/or sell copies of the Software, and to
 
12
 * permit persons to whom the Software is furnished to do so, subject to
 
13
 * the following conditions:
 
14
 *
 
15
 * The above copyright notice and this permission notice (including the
 
16
 * next paragraph) shall be included in all copies or substantial portions
 
17
 * of the Software.
 
18
 *
 
19
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
 
20
 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 
21
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
 
22
 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 
23
 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
 
24
 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
 
25
 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
26
 *
 
27
 */
 
28
 
 
29
#include "dvo.h"
 
30
#include "i915_reg.h"
 
31
#include "i915_drv.h"
 
32
 
 
33
#define NS2501_VID 0x1305
 
34
#define NS2501_DID 0x6726
 
35
 
 
36
#define NS2501_VID_LO 0x00
 
37
#define NS2501_VID_HI 0x01
 
38
#define NS2501_DID_LO 0x02
 
39
#define NS2501_DID_HI 0x03
 
40
#define NS2501_REV 0x04
 
41
#define NS2501_RSVD 0x05
 
42
#define NS2501_FREQ_LO 0x06
 
43
#define NS2501_FREQ_HI 0x07
 
44
 
 
45
#define NS2501_REG8 0x08
 
46
#define NS2501_8_VEN (1<<5)
 
47
#define NS2501_8_HEN (1<<4)
 
48
#define NS2501_8_DSEL (1<<3)
 
49
#define NS2501_8_BPAS (1<<2)
 
50
#define NS2501_8_RSVD (1<<1)
 
51
#define NS2501_8_PD (1<<0)
 
52
 
 
53
#define NS2501_REG9 0x09
 
54
#define NS2501_9_VLOW (1<<7)
 
55
#define NS2501_9_MSEL_MASK (0x7<<4)
 
56
#define NS2501_9_TSEL (1<<3)
 
57
#define NS2501_9_RSEN (1<<2)
 
58
#define NS2501_9_RSVD (1<<1)
 
59
#define NS2501_9_MDI (1<<0)
 
60
 
 
61
#define NS2501_REGC 0x0c
 
62
 
 
63
struct ns2501_priv {
 
64
        //I2CDevRec d;
 
65
        bool quiet;
 
66
        int reg_8_shadow;
 
67
        int reg_8_set;
 
68
        // Shadow registers for i915
 
69
        int dvoc;
 
70
        int pll_a;
 
71
        int srcdim;
 
72
        int fw_blc;
 
73
};
 
74
 
 
75
#define NSPTR(d) ((NS2501Ptr)(d->DriverPrivate.ptr))
 
76
 
 
77
/*
 
78
 * For reasons unclear to me, the ns2501 at least on the Fujitsu/Siemens
 
79
 * laptops does not react on the i2c bus unless
 
80
 * both the PLL is running and the display is configured in its native
 
81
 * resolution.
 
82
 * This function forces the DVO on, and stores the registers it touches.
 
83
 * Afterwards, registers are restored to regular values.
 
84
 *
 
85
 * This is pretty much a hack, though it works.
 
86
 * Without that, ns2501_readb and ns2501_writeb fail
 
87
 * when switching the resolution.
 
88
 */
 
89
 
 
90
static void enable_dvo(struct intel_dvo_device *dvo)
 
91
{
 
92
        struct ns2501_priv *ns = (struct ns2501_priv *)(dvo->dev_priv);
 
93
        struct i2c_adapter *adapter = dvo->i2c_bus;
 
94
        struct intel_gmbus *bus = container_of(adapter,
 
95
                                               struct intel_gmbus,
 
96
                                               adapter);
 
97
        struct drm_i915_private *dev_priv = bus->dev_priv;
 
98
 
 
99
        DRM_DEBUG_KMS("%s: Trying to re-enable the DVO\n", __FUNCTION__);
 
100
 
 
101
        ns->dvoc = I915_READ(DVO_C);
 
102
        ns->pll_a = I915_READ(_DPLL_A);
 
103
        ns->srcdim = I915_READ(DVOC_SRCDIM);
 
104
        ns->fw_blc = I915_READ(FW_BLC);
 
105
 
 
106
        I915_WRITE(DVOC, 0x10004084);
 
107
        I915_WRITE(_DPLL_A, 0xd0820000);
 
108
        I915_WRITE(DVOC_SRCDIM, 0x400300);      // 1024x768
 
109
        I915_WRITE(FW_BLC, 0x1080304);
 
110
 
 
111
        I915_WRITE(DVOC, 0x90004084);
 
112
}
 
113
 
 
114
/*
 
115
 * Restore the I915 registers modified by the above
 
116
 * trigger function.
 
117
 */
 
118
static void restore_dvo(struct intel_dvo_device *dvo)
 
119
{
 
120
        struct i2c_adapter *adapter = dvo->i2c_bus;
 
121
        struct intel_gmbus *bus = container_of(adapter,
 
122
                                               struct intel_gmbus,
 
123
                                               adapter);
 
124
        struct drm_i915_private *dev_priv = bus->dev_priv;
 
125
        struct ns2501_priv *ns = (struct ns2501_priv *)(dvo->dev_priv);
 
126
 
 
127
        I915_WRITE(DVOC, ns->dvoc);
 
128
        I915_WRITE(_DPLL_A, ns->pll_a);
 
129
        I915_WRITE(DVOC_SRCDIM, ns->srcdim);
 
130
        I915_WRITE(FW_BLC, ns->fw_blc);
 
131
}
 
132
 
 
133
/*
 
134
** Read a register from the ns2501.
 
135
** Returns true if successful, false otherwise.
 
136
** If it returns false, it might be wise to enable the
 
137
** DVO with the above function.
 
138
*/
 
139
static bool ns2501_readb(struct intel_dvo_device *dvo, int addr, uint8_t * ch)
 
140
{
 
141
        struct ns2501_priv *ns = dvo->dev_priv;
 
142
        struct i2c_adapter *adapter = dvo->i2c_bus;
 
143
        u8 out_buf[2];
 
144
        u8 in_buf[2];
 
145
 
 
146
        struct i2c_msg msgs[] = {
 
147
                {
 
148
                 .addr = dvo->slave_addr,
 
149
                 .flags = 0,
 
150
                 .len = 1,
 
151
                 .buf = out_buf,
 
152
                 },
 
153
                {
 
154
                 .addr = dvo->slave_addr,
 
155
                 .flags = I2C_M_RD,
 
156
                 .len = 1,
 
157
                 .buf = in_buf,
 
158
                 }
 
159
        };
 
160
 
 
161
        out_buf[0] = addr;
 
162
        out_buf[1] = 0;
 
163
 
 
164
        if (i2c_transfer(adapter, msgs, 2) == 2) {
 
165
                *ch = in_buf[0];
 
166
                return true;
 
167
        };
 
168
 
 
169
        if (!ns->quiet) {
 
170
                DRM_DEBUG_KMS
 
171
                    ("Unable to read register 0x%02x from %s:0x%02x.\n", addr,
 
172
                     adapter->name, dvo->slave_addr);
 
173
        }
 
174
 
 
175
        return false;
 
176
}
 
177
 
 
178
/*
 
179
** Write a register to the ns2501.
 
180
** Returns true if successful, false otherwise.
 
181
** If it returns false, it might be wise to enable the
 
182
** DVO with the above function.
 
183
*/
 
184
static bool ns2501_writeb(struct intel_dvo_device *dvo, int addr, uint8_t ch)
 
185
{
 
186
        struct ns2501_priv *ns = dvo->dev_priv;
 
187
        struct i2c_adapter *adapter = dvo->i2c_bus;
 
188
        uint8_t out_buf[2];
 
189
 
 
190
        struct i2c_msg msg = {
 
191
                .addr = dvo->slave_addr,
 
192
                .flags = 0,
 
193
                .len = 2,
 
194
                .buf = out_buf,
 
195
        };
 
196
 
 
197
        out_buf[0] = addr;
 
198
        out_buf[1] = ch;
 
199
 
 
200
        if (i2c_transfer(adapter, &msg, 1) == 1) {
 
201
                return true;
 
202
        }
 
203
 
 
204
        if (!ns->quiet) {
 
205
                DRM_DEBUG_KMS("Unable to write register 0x%02x to %s:%d\n",
 
206
                              addr, adapter->name, dvo->slave_addr);
 
207
        }
 
208
 
 
209
        return false;
 
210
}
 
211
 
 
212
/* National Semiconductor 2501 driver for chip on i2c bus
 
213
 * scan for the chip on the bus.
 
214
 * Hope the VBIOS initialized the PLL correctly so we can
 
215
 * talk to it. If not, it will not be seen and not detected.
 
216
 * Bummer!
 
217
 */
 
218
static bool ns2501_init(struct intel_dvo_device *dvo,
 
219
                        struct i2c_adapter *adapter)
 
220
{
 
221
        /* this will detect the NS2501 chip on the specified i2c bus */
 
222
        struct ns2501_priv *ns;
 
223
        unsigned char ch;
 
224
 
 
225
        ns = kzalloc(sizeof(struct ns2501_priv), GFP_KERNEL);
 
226
        if (ns == NULL)
 
227
                return false;
 
228
 
 
229
        dvo->i2c_bus = adapter;
 
230
        dvo->dev_priv = ns;
 
231
        ns->quiet = true;
 
232
 
 
233
        if (!ns2501_readb(dvo, NS2501_VID_LO, &ch))
 
234
                goto out;
 
235
 
 
236
        if (ch != (NS2501_VID & 0xff)) {
 
237
                DRM_DEBUG_KMS("ns2501 not detected got %d: from %s Slave %d.\n",
 
238
                              ch, adapter->name, dvo->slave_addr);
 
239
                goto out;
 
240
        }
 
241
 
 
242
        if (!ns2501_readb(dvo, NS2501_DID_LO, &ch))
 
243
                goto out;
 
244
 
 
245
        if (ch != (NS2501_DID & 0xff)) {
 
246
                DRM_DEBUG_KMS("ns2501 not detected got %d: from %s Slave %d.\n",
 
247
                              ch, adapter->name, dvo->slave_addr);
 
248
                goto out;
 
249
        }
 
250
        ns->quiet = false;
 
251
        ns->reg_8_set = 0;
 
252
        ns->reg_8_shadow =
 
253
            NS2501_8_PD | NS2501_8_BPAS | NS2501_8_VEN | NS2501_8_HEN;
 
254
 
 
255
        DRM_DEBUG_KMS("init ns2501 dvo controller successfully!\n");
 
256
        return true;
 
257
 
 
258
out:
 
259
        kfree(ns);
 
260
        return false;
 
261
}
 
262
 
 
263
static enum drm_connector_status ns2501_detect(struct intel_dvo_device *dvo)
 
264
{
 
265
        /*
 
266
         * This is a Laptop display, it doesn't have hotplugging.
 
267
         * Even if not, the detection bit of the 2501 is unreliable as
 
268
         * it only works for some display types.
 
269
         * It is even more unreliable as the PLL must be active for
 
270
         * allowing reading from the chiop.
 
271
         */
 
272
        return connector_status_connected;
 
273
}
 
274
 
 
275
static enum drm_mode_status ns2501_mode_valid(struct intel_dvo_device *dvo,
 
276
                                              struct drm_display_mode *mode)
 
277
{
 
278
        DRM_DEBUG_KMS
 
279
            ("%s: is mode valid (hdisplay=%d,htotal=%d,vdisplay=%d,vtotal=%d)\n",
 
280
             __FUNCTION__, mode->hdisplay, mode->htotal, mode->vdisplay,
 
281
             mode->vtotal);
 
282
 
 
283
        /*
 
284
         * Currently, these are all the modes I have data from.
 
285
         * More might exist. Unclear how to find the native resolution
 
286
         * of the panel in here so we could always accept it
 
287
         * by disabling the scaler.
 
288
         */
 
289
        if ((mode->hdisplay == 800 && mode->vdisplay == 600) ||
 
290
            (mode->hdisplay == 640 && mode->vdisplay == 480) ||
 
291
            (mode->hdisplay == 1024 && mode->vdisplay == 768)) {
 
292
                return MODE_OK;
 
293
        } else {
 
294
                return MODE_ONE_SIZE;   /* Is this a reasonable error? */
 
295
        }
 
296
}
 
297
 
 
298
static void ns2501_mode_set(struct intel_dvo_device *dvo,
 
299
                            struct drm_display_mode *mode,
 
300
                            struct drm_display_mode *adjusted_mode)
 
301
{
 
302
        bool ok;
 
303
        bool restore = false;
 
304
        struct ns2501_priv *ns = (struct ns2501_priv *)(dvo->dev_priv);
 
305
 
 
306
        DRM_DEBUG_KMS
 
307
            ("%s: set mode (hdisplay=%d,htotal=%d,vdisplay=%d,vtotal=%d).\n",
 
308
             __FUNCTION__, mode->hdisplay, mode->htotal, mode->vdisplay,
 
309
             mode->vtotal);
 
310
 
 
311
        /*
 
312
         * Where do I find the native resolution for which scaling is not required???
 
313
         *
 
314
         * First trigger the DVO on as otherwise the chip does not appear on the i2c
 
315
         * bus.
 
316
         */
 
317
        do {
 
318
                ok = true;
 
319
 
 
320
                if (mode->hdisplay == 800 && mode->vdisplay == 600) {
 
321
                        /* mode 277 */
 
322
                        ns->reg_8_shadow &= ~NS2501_8_BPAS;
 
323
                        DRM_DEBUG_KMS("%s: switching to 800x600\n",
 
324
                                      __FUNCTION__);
 
325
 
 
326
                        /*
 
327
                         * No, I do not know where this data comes from.
 
328
                         * It is just what the video bios left in the DVO, so
 
329
                         * I'm just copying it here over.
 
330
                         * This also means that I cannot support any other modes
 
331
                         * except the ones supported by the bios.
 
332
                         */
 
333
                        ok &= ns2501_writeb(dvo, 0x11, 0xc8);   // 0xc7 also works.
 
334
                        ok &= ns2501_writeb(dvo, 0x1b, 0x19);
 
335
                        ok &= ns2501_writeb(dvo, 0x1c, 0x62);   // VBIOS left 0x64 here, but 0x62 works nicer
 
336
                        ok &= ns2501_writeb(dvo, 0x1d, 0x02);
 
337
 
 
338
                        ok &= ns2501_writeb(dvo, 0x34, 0x03);
 
339
                        ok &= ns2501_writeb(dvo, 0x35, 0xff);
 
340
 
 
341
                        ok &= ns2501_writeb(dvo, 0x80, 0x27);
 
342
                        ok &= ns2501_writeb(dvo, 0x81, 0x03);
 
343
                        ok &= ns2501_writeb(dvo, 0x82, 0x41);
 
344
                        ok &= ns2501_writeb(dvo, 0x83, 0x05);
 
345
 
 
346
                        ok &= ns2501_writeb(dvo, 0x8d, 0x02);
 
347
                        ok &= ns2501_writeb(dvo, 0x8e, 0x04);
 
348
                        ok &= ns2501_writeb(dvo, 0x8f, 0x00);
 
349
 
 
350
                        ok &= ns2501_writeb(dvo, 0x90, 0xfe);   /* vertical. VBIOS left 0xff here, but 0xfe works better */
 
351
                        ok &= ns2501_writeb(dvo, 0x91, 0x07);
 
352
                        ok &= ns2501_writeb(dvo, 0x94, 0x00);
 
353
                        ok &= ns2501_writeb(dvo, 0x95, 0x00);
 
354
 
 
355
                        ok &= ns2501_writeb(dvo, 0x96, 0x00);
 
356
 
 
357
                        ok &= ns2501_writeb(dvo, 0x99, 0x00);
 
358
                        ok &= ns2501_writeb(dvo, 0x9a, 0x88);
 
359
 
 
360
                        ok &= ns2501_writeb(dvo, 0x9c, 0x23);   /* Looks like first and last line of the image. */
 
361
                        ok &= ns2501_writeb(dvo, 0x9d, 0x00);
 
362
                        ok &= ns2501_writeb(dvo, 0x9e, 0x25);
 
363
                        ok &= ns2501_writeb(dvo, 0x9f, 0x03);
 
364
 
 
365
                        ok &= ns2501_writeb(dvo, 0xa4, 0x80);
 
366
 
 
367
                        ok &= ns2501_writeb(dvo, 0xb6, 0x00);
 
368
 
 
369
                        ok &= ns2501_writeb(dvo, 0xb9, 0xc8);   /* horizontal? */
 
370
                        ok &= ns2501_writeb(dvo, 0xba, 0x00);   /* horizontal? */
 
371
 
 
372
                        ok &= ns2501_writeb(dvo, 0xc0, 0x05);   /* horizontal? */
 
373
                        ok &= ns2501_writeb(dvo, 0xc1, 0xd7);
 
374
 
 
375
                        ok &= ns2501_writeb(dvo, 0xc2, 0x00);
 
376
                        ok &= ns2501_writeb(dvo, 0xc3, 0xf8);
 
377
 
 
378
                        ok &= ns2501_writeb(dvo, 0xc4, 0x03);
 
379
                        ok &= ns2501_writeb(dvo, 0xc5, 0x1a);
 
380
 
 
381
                        ok &= ns2501_writeb(dvo, 0xc6, 0x00);
 
382
                        ok &= ns2501_writeb(dvo, 0xc7, 0x73);
 
383
                        ok &= ns2501_writeb(dvo, 0xc8, 0x02);
 
384
 
 
385
                } else if (mode->hdisplay == 640 && mode->vdisplay == 480) {
 
386
                        /* mode 274 */
 
387
                        DRM_DEBUG_KMS("%s: switching to 640x480\n",
 
388
                                      __FUNCTION__);
 
389
                        /*
 
390
                         * No, I do not know where this data comes from.
 
391
                         * It is just what the video bios left in the DVO, so
 
392
                         * I'm just copying it here over.
 
393
                         * This also means that I cannot support any other modes
 
394
                         * except the ones supported by the bios.
 
395
                         */
 
396
                        ns->reg_8_shadow &= ~NS2501_8_BPAS;
 
397
 
 
398
                        ok &= ns2501_writeb(dvo, 0x11, 0xa0);
 
399
                        ok &= ns2501_writeb(dvo, 0x1b, 0x11);
 
400
                        ok &= ns2501_writeb(dvo, 0x1c, 0x54);
 
401
                        ok &= ns2501_writeb(dvo, 0x1d, 0x03);
 
402
 
 
403
                        ok &= ns2501_writeb(dvo, 0x34, 0x03);
 
404
                        ok &= ns2501_writeb(dvo, 0x35, 0xff);
 
405
 
 
406
                        ok &= ns2501_writeb(dvo, 0x80, 0xff);
 
407
                        ok &= ns2501_writeb(dvo, 0x81, 0x07);
 
408
                        ok &= ns2501_writeb(dvo, 0x82, 0x3d);
 
409
                        ok &= ns2501_writeb(dvo, 0x83, 0x05);
 
410
 
 
411
                        ok &= ns2501_writeb(dvo, 0x8d, 0x02);
 
412
                        ok &= ns2501_writeb(dvo, 0x8e, 0x10);
 
413
                        ok &= ns2501_writeb(dvo, 0x8f, 0x00);
 
414
 
 
415
                        ok &= ns2501_writeb(dvo, 0x90, 0xff);   /* vertical */
 
416
                        ok &= ns2501_writeb(dvo, 0x91, 0x07);
 
417
                        ok &= ns2501_writeb(dvo, 0x94, 0x00);
 
418
                        ok &= ns2501_writeb(dvo, 0x95, 0x00);
 
419
 
 
420
                        ok &= ns2501_writeb(dvo, 0x96, 0x05);
 
421
 
 
422
                        ok &= ns2501_writeb(dvo, 0x99, 0x00);
 
423
                        ok &= ns2501_writeb(dvo, 0x9a, 0x88);
 
424
 
 
425
                        ok &= ns2501_writeb(dvo, 0x9c, 0x24);
 
426
                        ok &= ns2501_writeb(dvo, 0x9d, 0x00);
 
427
                        ok &= ns2501_writeb(dvo, 0x9e, 0x25);
 
428
                        ok &= ns2501_writeb(dvo, 0x9f, 0x03);
 
429
 
 
430
                        ok &= ns2501_writeb(dvo, 0xa4, 0x84);
 
431
 
 
432
                        ok &= ns2501_writeb(dvo, 0xb6, 0x09);
 
433
 
 
434
                        ok &= ns2501_writeb(dvo, 0xb9, 0xa0);   /* horizontal? */
 
435
                        ok &= ns2501_writeb(dvo, 0xba, 0x00);   /* horizontal? */
 
436
 
 
437
                        ok &= ns2501_writeb(dvo, 0xc0, 0x05);   /* horizontal? */
 
438
                        ok &= ns2501_writeb(dvo, 0xc1, 0x90);
 
439
 
 
440
                        ok &= ns2501_writeb(dvo, 0xc2, 0x00);
 
441
                        ok &= ns2501_writeb(dvo, 0xc3, 0x0f);
 
442
 
 
443
                        ok &= ns2501_writeb(dvo, 0xc4, 0x03);
 
444
                        ok &= ns2501_writeb(dvo, 0xc5, 0x16);
 
445
 
 
446
                        ok &= ns2501_writeb(dvo, 0xc6, 0x00);
 
447
                        ok &= ns2501_writeb(dvo, 0xc7, 0x02);
 
448
                        ok &= ns2501_writeb(dvo, 0xc8, 0x02);
 
449
 
 
450
                } else if (mode->hdisplay == 1024 && mode->vdisplay == 768) {
 
451
                        /* mode 280 */
 
452
                        DRM_DEBUG_KMS("%s: switching to 1024x768\n",
 
453
                                      __FUNCTION__);
 
454
                        /*
 
455
                         * This might or might not work, actually. I'm silently
 
456
                         * assuming here that the native panel resolution is
 
457
                         * 1024x768. If not, then this leaves the scaler disabled
 
458
                         * generating a picture that is likely not the expected.
 
459
                         *
 
460
                         * Problem is that I do not know where to take the panel
 
461
                         * dimensions from.
 
462
                         *
 
463
                         * Enable the bypass, scaling not required.
 
464
                         *
 
465
                         * The scaler registers are irrelevant here....
 
466
                         *
 
467
                         */
 
468
                        ns->reg_8_shadow |= NS2501_8_BPAS;
 
469
                        ok &= ns2501_writeb(dvo, 0x37, 0x44);
 
470
                } else {
 
471
                        /*
 
472
                         * Data not known. Bummer!
 
473
                         * Hopefully, the code should not go here
 
474
                         * as mode_OK delivered no other modes.
 
475
                         */
 
476
                        ns->reg_8_shadow |= NS2501_8_BPAS;
 
477
                }
 
478
                ok &= ns2501_writeb(dvo, NS2501_REG8, ns->reg_8_shadow);
 
479
 
 
480
                if (!ok) {
 
481
                        if (restore)
 
482
                                restore_dvo(dvo);
 
483
                        enable_dvo(dvo);
 
484
                        restore = true;
 
485
                }
 
486
        } while (!ok);
 
487
        /*
 
488
         * Restore the old i915 registers before
 
489
         * forcing the ns2501 on.
 
490
         */
 
491
        if (restore)
 
492
                restore_dvo(dvo);
 
493
}
 
494
 
 
495
/* set the NS2501 power state */
 
496
static bool ns2501_get_hw_state(struct intel_dvo_device *dvo)
 
497
{
 
498
        unsigned char ch;
 
499
 
 
500
        if (!ns2501_readb(dvo, NS2501_REG8, &ch))
 
501
                return false;
 
502
 
 
503
        if (ch & NS2501_8_PD)
 
504
                return true;
 
505
        else
 
506
                return false;
 
507
}
 
508
 
 
509
/* set the NS2501 power state */
 
510
static void ns2501_dpms(struct intel_dvo_device *dvo, bool enable)
 
511
{
 
512
        bool ok;
 
513
        bool restore = false;
 
514
        struct ns2501_priv *ns = (struct ns2501_priv *)(dvo->dev_priv);
 
515
        unsigned char ch;
 
516
 
 
517
        DRM_DEBUG_KMS("%s: Trying set the dpms of the DVO to %i\n",
 
518
                      __FUNCTION__, enable);
 
519
 
 
520
        ch = ns->reg_8_shadow;
 
521
 
 
522
        if (enable)
 
523
                ch |= NS2501_8_PD;
 
524
        else
 
525
                ch &= ~NS2501_8_PD;
 
526
 
 
527
        if (ns->reg_8_set == 0 || ns->reg_8_shadow != ch) {
 
528
                ns->reg_8_set = 1;
 
529
                ns->reg_8_shadow = ch;
 
530
 
 
531
                do {
 
532
                        ok = true;
 
533
                        ok &= ns2501_writeb(dvo, NS2501_REG8, ch);
 
534
                        ok &=
 
535
                            ns2501_writeb(dvo, 0x34,
 
536
                                          enable ? 0x03 : 0x00);
 
537
                        ok &=
 
538
                            ns2501_writeb(dvo, 0x35,
 
539
                                          enable ? 0xff : 0x00);
 
540
                        if (!ok) {
 
541
                                if (restore)
 
542
                                        restore_dvo(dvo);
 
543
                                enable_dvo(dvo);
 
544
                                restore = true;
 
545
                        }
 
546
                } while (!ok);
 
547
 
 
548
                if (restore)
 
549
                        restore_dvo(dvo);
 
550
        }
 
551
}
 
552
 
 
553
static void ns2501_dump_regs(struct intel_dvo_device *dvo)
 
554
{
 
555
        uint8_t val;
 
556
 
 
557
        ns2501_readb(dvo, NS2501_FREQ_LO, &val);
 
558
        DRM_LOG_KMS("NS2501_FREQ_LO: 0x%02x\n", val);
 
559
        ns2501_readb(dvo, NS2501_FREQ_HI, &val);
 
560
        DRM_LOG_KMS("NS2501_FREQ_HI: 0x%02x\n", val);
 
561
        ns2501_readb(dvo, NS2501_REG8, &val);
 
562
        DRM_LOG_KMS("NS2501_REG8: 0x%02x\n", val);
 
563
        ns2501_readb(dvo, NS2501_REG9, &val);
 
564
        DRM_LOG_KMS("NS2501_REG9: 0x%02x\n", val);
 
565
        ns2501_readb(dvo, NS2501_REGC, &val);
 
566
        DRM_LOG_KMS("NS2501_REGC: 0x%02x\n", val);
 
567
}
 
568
 
 
569
static void ns2501_destroy(struct intel_dvo_device *dvo)
 
570
{
 
571
        struct ns2501_priv *ns = dvo->dev_priv;
 
572
 
 
573
        if (ns) {
 
574
                kfree(ns);
 
575
                dvo->dev_priv = NULL;
 
576
        }
 
577
}
 
578
 
 
579
struct intel_dvo_dev_ops ns2501_ops = {
 
580
        .init = ns2501_init,
 
581
        .detect = ns2501_detect,
 
582
        .mode_valid = ns2501_mode_valid,
 
583
        .mode_set = ns2501_mode_set,
 
584
        .dpms = ns2501_dpms,
 
585
        .get_hw_state = ns2501_get_hw_state,
 
586
        .dump_regs = ns2501_dump_regs,
 
587
        .destroy = ns2501_destroy,
 
588
};