aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-powerpc/smu.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-powerpc/smu.h')
-rw-r--r--include/asm-powerpc/smu.h34
1 files changed, 18 insertions, 16 deletions
diff --git a/include/asm-powerpc/smu.h b/include/asm-powerpc/smu.h
index 76c29a9784dd..134c2b5be0f2 100644
--- a/include/asm-powerpc/smu.h
+++ b/include/asm-powerpc/smu.h
@@ -4,9 +4,11 @@
4/* 4/*
5 * Definitions for talking to the SMU chip in newer G5 PowerMacs 5 * Definitions for talking to the SMU chip in newer G5 PowerMacs
6 */ 6 */
7 7#ifdef __KERNEL__
8#include <linux/config.h> 8#include <linux/config.h>
9#include <linux/list.h> 9#include <linux/list.h>
10#endif
11#include <linux/types.h>
10 12
11/* 13/*
12 * Known SMU commands 14 * Known SMU commands
@@ -356,6 +358,9 @@ extern unsigned long smu_cmdbuf_abs;
356 * Kenrel asynchronous i2c interface 358 * Kenrel asynchronous i2c interface
357 */ 359 */
358 360
361#define SMU_I2C_READ_MAX 0x1d
362#define SMU_I2C_WRITE_MAX 0x15
363
359/* SMU i2c header, exactly matches i2c header on wire */ 364/* SMU i2c header, exactly matches i2c header on wire */
360struct smu_i2c_param 365struct smu_i2c_param
361{ 366{
@@ -366,12 +371,9 @@ struct smu_i2c_param
366 u8 subaddr[3]; /* subaddress */ 371 u8 subaddr[3]; /* subaddress */
367 u8 caddr; /* combined address, filled by SMU driver */ 372 u8 caddr; /* combined address, filled by SMU driver */
368 u8 datalen; /* length of transfer */ 373 u8 datalen; /* length of transfer */
369 u8 data[7]; /* data */ 374 u8 data[SMU_I2C_READ_MAX]; /* data */
370}; 375};
371 376
372#define SMU_I2C_READ_MAX 0x0d
373#define SMU_I2C_WRITE_MAX 0x05
374
375struct smu_i2c_cmd 377struct smu_i2c_cmd
376{ 378{
377 /* public */ 379 /* public */
@@ -385,7 +387,7 @@ struct smu_i2c_cmd
385 int read; 387 int read;
386 int stage; 388 int stage;
387 int retries; 389 int retries;
388 u8 pdata[0x10]; 390 u8 pdata[32];
389 struct list_head link; 391 struct list_head link;
390}; 392};
391 393
@@ -487,8 +489,8 @@ struct smu_sdbp_slotspow {
487#define SMU_SDB_SENSORTREE_ID 0x25 489#define SMU_SDB_SENSORTREE_ID 0x25
488 490
489struct smu_sdbp_sensortree { 491struct smu_sdbp_sensortree {
490 u8 model_id; 492 __u8 model_id;
491 u8 unknown[3]; 493 __u8 unknown[3];
492}; 494};
493 495
494/* This partition contains CPU thermal control PID informations. So far 496/* This partition contains CPU thermal control PID informations. So far
@@ -498,13 +500,13 @@ struct smu_sdbp_sensortree {
498#define SMU_SDB_CPUPIDDATA_ID 0x17 500#define SMU_SDB_CPUPIDDATA_ID 0x17
499 501
500struct smu_sdbp_cpupiddata { 502struct smu_sdbp_cpupiddata {
501 u8 unknown1; 503 __u8 unknown1;
502 u8 target_temp_delta; 504 __u8 target_temp_delta;
503 u8 unknown2; 505 __u8 unknown2;
504 u8 history_len; 506 __u8 history_len;
505 s16 power_adj; 507 __s16 power_adj;
506 u16 max_power; 508 __u16 max_power;
507 s32 gp,gr,gd; 509 __s32 gp,gr,gd;
508}; 510};
509 511
510 512
@@ -517,7 +519,7 @@ struct smu_sdbp_cpupiddata {
517 * if not found. The data format is described below 519 * if not found. The data format is described below
518 */ 520 */
519extern struct smu_sdbp_header *smu_get_sdb_partition(int id, 521extern struct smu_sdbp_header *smu_get_sdb_partition(int id,
520 unsigned int *size); 522 unsigned int *size);
521 523
522#endif /* __KERNEL__ */ 524#endif /* __KERNEL__ */
523 525