コード例 #1
0
ファイル: sysfs_backlight.c プロジェクト: sole/pommed-fork
int
mbp_sysfs_backlight_probe(void)
{
  int ret;

  ret = sysfs_backlight_probe(SYSFS_DRIVER_MBP);

  if (ret == 0)
    return 0;

  ret = sysfs_backlight_probe(SYSFS_DRIVER_NOUVEAU);

  if (ret == 0)
    return 0;

  ret = sysfs_backlight_probe(SYSFS_DRIVER_NVIDIA);

  if (ret == 0)
    return 0;

  /* Probe failed, wire up native driver instead */
  switch (mops->type)
    {
      case MACHINE_MACBOOKPRO_3:
      case MACHINE_MACBOOKPRO_4:
      case MACHINE_MACBOOKPRO_5:
      case MACHINE_MACBOOKPRO_6:
      case MACHINE_MACBOOK_5:
      case MACHINE_MACBOOK_6:
      case MACHINE_MACBOOKAIR_2:
      case MACHINE_MACBOOKAIR_3:
	logmsg(LOG_INFO, "sysfs backlight probe failed, falling back to nv8600mgt");

	ret = nv8600mgt_backlight_probe();
	if (ret == 0)
	  {
	    /* Wire up fallback native driver */
	    mops->lcd_backlight_step = nv8600mgt_backlight_step;
	    mops->lcd_backlight_toggle = nv8600mgt_backlight_toggle;
	  }
	return ret;

      default:
	logmsg(LOG_ERR, "sysfs backlight probe failed, no fallback for this machine");
	return -1;
    }

  return -1;
}
コード例 #2
0
int
nvidia_sysfs_backlight_probe(void)
{
  return sysfs_backlight_probe(SYSFS_DRIVER_NVIDIA);
}
コード例 #3
0
int
r9x00_sysfs_backlight_probe(void)
{
  return sysfs_backlight_probe(SYSFS_DRIVER_RADEON);
}
コード例 #4
0
int
aty128_sysfs_backlight_probe(void)
{
  return sysfs_backlight_probe(SYSFS_DRIVER_ATY128);
}